Files
ladybird/Libraries/LibWeb/CSS/StyleInvalidationData.cpp
Andreas Kling 62440c1472 LibWeb: Make :host, :root, and interaction-state pseudos targetable
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.
2026-05-07 19:32:27 +02:00

28 KiB