1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 17:37:37 +00:00

LibWeb: Move mouse event and label logic from layout to painting tree

Input events have nothing to do with layout, so let's not send them to
layout nodes.

The job of Paintable starts to become clear. It represents a paintable
item that can be rendered into the viewport, which means it can also
be targeted by the mouse cursor.
This commit is contained in:
Andreas Kling 2022-03-10 22:46:35 +01:00
parent ed84fbce47
commit cb0c5390ff
35 changed files with 560 additions and 429 deletions

View file

@ -13,9 +13,8 @@ namespace Web::Layout {
class LabelableNode : public ReplacedBox {
public:
virtual void handle_associated_label_mousedown(Badge<Label>) { }
virtual void handle_associated_label_mouseup(Badge<Label>) { }
virtual void handle_associated_label_mousemove(Badge<Label>, [[maybe_unused]] bool is_inside_node_or_label) { }
Painting::LabelablePaintable* paintable();
Painting::LabelablePaintable const* paintable() const;
protected:
LabelableNode(DOM::Document& document, DOM::Element& element, NonnullRefPtr<CSS::StyleProperties> style)