mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-11 17:37:33 +02:00
Stylesheet add/remove previously fell back to a whole-subtree invalidation whenever a sheet's rightmost compound carried one of these pseudo-classes. They each match a small, knowable set of elements at any moment, so the invalidation walk can target them directly: - :host matches one element per shadow root and :root matches the html element. Mark them targetable. - :hover, :focus, :focus-visible, :focus-within, :active, and :target all match at most a handful of elements at a time. Mark them targetable and add matchers in InvalidationSetMatcher that consult Document::hovered_node, focused_area, target_element, and the element's own focused/active state.
28 KiB
28 KiB