summaryrefslogtreecommitdiff
path: root/Libraries/LibWeb/Page
AgeCommit message (Collapse)Author
2021-01-09LibWeb: Convert a bunch of dbg() to dbgln()Andreas Kling
2021-01-04LibWeb: Restart the cursor blink cycle whenever the user edits contentAndreas Kling
Having the text cursor disappear during rapid continuous editing is quite jarring, so let's make sure we always restart the blink cycle whenever the user performs some kind of editing action in a frame.
2020-12-21Everywhere: Switch from (void) to [[maybe_unused]] (#4473)Lenny Maiorani
Problem: - `(void)` simply casts the expression to void. This is understood to indicate that it is ignored, but this is really a compiler trick to get the compiler to not generate a warning. Solution: - Use the `[[maybe_unused]]` attribute to indicate the value is unused. Note: - Functions taking a `(void)` argument list have also been changed to `()` because this is not needed and shows up in the same grep command.
2020-12-14LibWeb: Don't replace selection on key press in non-editable contentAndreas Kling
2020-12-14LibWeb: Merge Document::layout() and Document::update_layout()Andreas Kling
There is now only Document::update_layout().
2020-12-13LibWeb: Attach DOM::Document to its frame before parsingAndreas Kling
FrameLoader now begins by constructing a DOM::Document, and then builds a document tree inside it based on the MIME type. For text/html we pass control to the HTMLDocumentParser as before. This gives us access to things like window.alert() during parsing. Fixes #3973.
2020-12-12LibWeb: Store layout box model metrics as floatsAndreas Kling
Instead of storing them as CSS::Lengths, we now store the resolved values for margin/padding/border/offset top/right/bottom/left with each Layout::NodeWithStyleAndBoxModelMetrics. This simplifies a lot of code since it's no longer necessary to resolve values before using them.
2020-12-09LibWeb: Make DOM::Range more suitable for JS.asynts
2020-12-09LibWeb: Join start and end after deleting selection.asynts
2020-12-09LibWeb: Implement deletion of more complex selections.asynts
2020-12-09LibWeb: Fix many bugs with the editing.asynts
2020-12-09LibWeb: Add support for cursor movement and delete.asynts
2020-12-09LibWeb: Support range delection accross nodes with shared parent.asynts
2020-12-09LibWeb: Add support for range deletion.asynts
2020-12-09LibWeb: Move editing stuff into EditEventHandler.asynts
2020-12-08LibWeb+WebContent: Add on_load_finish hook to web viewsAndreas Kling
This isn't entirely symmetrical with on_load_start as it will also fire on reloads and back/forward navigations. However, it's good enough for some basic use cases, and we can do more sophisticated notifications later on when we need them.
2020-12-02LibWeb: Layout viewport rect was lagging behind when resizingAndreas Kling
Layout was using an outdated viewport rect that we set *after* doing a layout due to resize. That meant that layout-in-response-to-resize was always lagging behind the current size of the view. The root of this problem was how Frame kept both a viewport rect (with both scroll offset and size) and a frame size. To fix this, only store the viewport scroll offset, and always use the frame size. This way they can't get out of sync and the problem goes away. :^) Fixes #4250.
2020-11-29LibWeb: Abort event handling if underlying layout tree disappearsAndreas Kling
We didn't notice that the layout tree had disappeared after dispatching a mousedown event, because we only checked EventHandler::layout_root() which happily returned the *new* layout tree after a window.reload(). This patch fixes that by verifying that the frame is still showing the same DOM's layout tree after event dispatch. Fixes #4224.
2020-11-22LibWeb: Add HTML::EventNames and UIEvents::EventNamesLuke
2020-11-22LibWeb: Rename LayoutNode classes and move them into Layout namespaceAndreas Kling
Bring the names of various boxes closer to spec language. This should hopefully make things easier to understand and hack on. :^) Some notable changes: - LayoutNode -> Layout::Node - LayoutBox -> Layout::Box - LayoutBlock -> Layout::BlockBox - LayoutReplaced -> Layout::ReplacedBox - LayoutDocument -> Layout::InitialContainingBlockBox - LayoutText -> Layout::TextNode - LayoutInline -> Layout::InlineNode Note that this is not strictly a "box tree" as we also hang inline/text nodes in the same tree, and they don't generate boxes. (Instead, they contribute line box fragments to their containing block!)
2020-11-22LibWeb: Rename LayoutNode::node() => LayoutNode::dom_node()Andreas Kling
2020-11-19LibWeb: Remove ancient HTML_DEBUG debug loggingAndreas Kling
2020-11-12LibWeb: Make Frame point weakly to PageAndreas Kling
This patch makes Page weakable and allows page-less frames to exist. Page is single-owner, and Frame is multiple-owner, so it's not sound for Frame to assume its containing Page will stick around for its own entire lifetime. Fixes #3976.
2020-11-10AK: Make RefPtr, NonnullRefPtr, WeakPtr thread safeTom
This makes most operations thread safe, especially so that they can safely be used in the Kernel. This includes obtaining a strong reference from a weak reference, which now requires an explicit call to WeakPtr::strong_ref(). Another major change is that Weakable::make_weak_ref() may require the explicit target type. Previously we used reinterpret_cast in WeakPtr, assuming that it can be properly converted. But WeakPtr does not necessarily have the knowledge to be able to do this. Instead, we now ask the class itself to deliver a WeakPtr to the type that we want. Also, WeakLink is no longer specific to a target type. The reason for this is that we want to be able to safely convert e.g. WeakPtr<T> to WeakPtr<U>, and before this we just reinterpret_cast the internal WeakLink<T> to WeakLink<U>, which is a bold assumption that it would actually produce the correct code. Instead, WeakLink now operates on just a raw pointer and we only make those constructors/operators available if we can verify that it can be safely cast. In order to guarantee thread safety, we now use the least significant bit in the pointer for locking purposes. This also means that only properly aligned pointers can be used.
2020-10-22LibWeb: Forget frame selection when changing documentsAndreas Kling
The old selection is obviously not relevant in the new document.
2020-10-08LibWeb: Add OutOfProcessWebView::load_html()Linus Groh
2020-10-08LibWeb: Handle PageClient::page_did_change_title() in Frame::set_document()Linus Groh
2020-10-07LibWeb: Use RefPtrs more in getElementById() and getElementsByName()Andreas Kling
Passing around Vector<Element*> is not a great idea long-term.
2020-10-02LibWeb: Add a PageClient callback for image context menu requestsAndreas Kling
When the user right-clicks on an image, you might want to show a special context menu, separate from the regular link context menu. This patch only implements enough of the functionality to get this working in a single-process context.
2020-09-28ProtocolServer+LibWeb: Support more detailed HTTP requestsAndreas Kling
This patch adds the ability for ProtocolServer clients to specify which HTTP method to use, and also to include an optional HTTP request body.
2020-09-25Meta+LibHTTP through LibWeb: Make clang-format-10 cleanBen Wiederhake
2020-09-22LibWeb: Rename HTMLIFrameElement::hosted_frame() => content_frame()Andreas Kling
This matches the standard API names contentWindow and contentDocument.
2020-09-12LibWeb: Two mouse event handling fixesAndreas Kling
- After letting a LayoutNode handle a mouseup, re-do the hit test since things may have changed. - Make sure we always update the document's hovered node.
2020-09-12LibWeb: Support window.alert() in multi-process contextAndreas Kling
Alerts are now delegated to the embedding GUI process.
2020-09-11LibWeb: Allow layout nodes to receive and track mouse eventsAndreas Kling
To implement form controls internally in LibWeb (necessary for multi process forms), we'll need the ability to handle events since we can't rely on LibGUI widgets anymore. A LayoutNode can now override wants_mouse_events() and if it returns true, it will now receive mousedown, mousemove and mouseup events. :^)
2020-09-10LibGfx: Move StandardCursor enum to LibGfxAndreas Kling
This enum existed both in LibGUI and WindowServer which was silly and error-prone.
2020-08-26LibWeb: Calculate selection based on glyph centersRewi Haar
Previously you had to drag all the way to the end of a glyph to select it; now you just need to drag past the center. Also fixes #2959.
2020-08-21LibWeb: Make selection state recomputation implicitAndreas Kling
Add a LayoutDocument API for modifying the selection and make clients call that so we can recompute selection states automatically.
2020-08-21LibWeb: Remember the selection state of each LayoutNodeAndreas Kling
Instead of computing it on the fly while painting each layout node, they now remember their selection state. This avoids a whole bunch of tree traversal while painting with anything selected.
2020-08-17LibWeb: Rename PageView => InProcessWebViewAndreas Kling
2020-08-17LibWeb: Change cursor to IBeam when hovering textAnicJov
This is what most browsers do, hopefully it isn't too silly :^)
2020-08-15LibWeb: Allow focusing individual (focusable) elements with Tab keyAndreas Kling
You can now cycle through focusable elements (currently only hyperlinks are focusable) with the Tab key. The focus outline is rendered in a new FocusOutline paint phase.
2020-08-14LibWeb: Don't paint a text cursor in unfocused framesAndreas Kling
2020-08-14LibWeb: Send keydown events to the focused frameAndreas Kling
2020-08-14LibWeb: Add "focused frame" concept, one focused Frame per PageAndreas Kling
Focus currently only moves when doing a mousedown in a frame.
2020-08-06LibWeb: Move text selection serialization from PageView to FrameAndreas Kling
This logic doesn't depend on anything at the widget layer, so it can move down to the frame layer.
2020-08-05Unicode: Try s/codepoint/code_point/g againNico Weber
This time, without trailing 's'. Ran: git grep -l 'codepoint' | xargs sed -ie 's/codepoint/code_point/g
2020-08-05Revert "Unicode: s/codepoint/code_point/g"Nico Weber
This reverts commit ea9ac3155d1774f13ac4e9a96605c0e85a8f299e. It replaced "codepoint" with "code_points", not "code_point".
2020-08-05LibWeb: Specialize hit testing for text cursor purposesAndreas Kling
The text cursor follows slightly different "intuitive" rules than the regular hit testing. Clicking past the right edge of a text box should still "hit" the text box, and place the cursor at its end, for example. We solve this by adding a HitTestType enum that is passed to hit_test() and determines whether past-the-edge candidates are considered.
2020-08-03Unicode: s/codepoint/code_point/gAndreas Kling
Unicode calls them "code points" so let's follow their style.