summaryrefslogtreecommitdiff
path: root/Libraries/LibWeb/Page/EventHandler.cpp
AgeCommit message (Collapse)Author
2020-12-09LibWeb: Make DOM::Range more suitable for JS.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-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-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-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-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-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: Add "focused frame" concept, one focused Frame per PageAndreas Kling
Focus currently only moves when doing a mousedown in a frame.
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.
2020-08-02LibWeb: Only allow editing of elements with contenteditable="true"Andreas Kling
We now respect the contenteditable HTML attribute and only let you edit content inside explicitly editable elements.
2020-08-02LibWeb: Add very basic backspace support to content editingAndreas Kling
2020-08-02LibWeb: Allow inserting text at the cursor by typing characters :^)Andreas Kling
This works everywhere right now, but it's obviously not going to stay that way forever. :^) Note that this does not advance the cursor correctly for whitespace since the cursor is DOM-based and doesn't take whitespace collapsing into account yet.
2020-08-02LibWeb: Add a blinking text cursor :^)Andreas Kling
Each Web::Frame now has a cursor that sits at a DOM::Position. It will blink and look like a nice regular text cursor. It doesn't really do anything yet, but it will eventually.
2020-07-28LibWeb: Move the Page/Frame/EventHandler classes into Page/Andreas Kling