LibWeb: Optimize hover style invalidation for shadow trees

With this change we skip all :hover selectors that don't belong to a
"style scope" (document or shadow root) of old/new hovered node.
This commit is contained in:
Aliaksandr Kalenik 2025-01-05 22:49:16 +03:00 committed by Andreas Kling
commit 5cac301bb7
Notes: github-actions[bot] 2025-01-06 11:15:58 +00:00
2 changed files with 36 additions and 6 deletions

View file

@ -174,7 +174,7 @@ public:
virtual FlyString node_name() const override { return "#document"_fly_string; }
void invalidate_style_for_elements_affected_by_hover_change(GC::Ptr<Node> old_new_hovered_common_ancestor, GC::Ptr<Node> hovered_node);
void invalidate_style_for_elements_affected_by_hover_change(Node& old_new_hovered_common_ancestor, GC::Ptr<Node> hovered_node);
void set_hovered_node(Node*);
Node* hovered_node() { return m_hovered_node.ptr(); }
Node const* hovered_node() const { return m_hovered_node.ptr(); }