ladybird/Libraries/LibWeb/CSS/Invalidation
Andreas Kling fa579754bf LibWeb: Use invalidation plans for pseudo-class changes
Replace PseudoClassInvalidator's subtree scan with targeted
invalidation for elements whose pseudo-class state changes. This scopes
state changes to affected selectors instead of rechecking a whole
common-ancestor subtree.

Use the ancestor chain that matches each pseudo-class. Hover walks the
shadow-including chain. :focus-within walks the flat-tree chain, so
slotted content invalidates its assigned slot and relevant shadow-tree
descendants. Focus, FocusVisible, and Target invalidate just the state
node.

Route each affected element through Element::invalidate_style with the
pseudo-class property. This uses the same invalidation-plan machinery as
Disabled, Checked, and other pseudo-class state changes.

Interaction state pseudo classes are not tracked in :has() metadata, so
schedule :has() ancestor invalidation explicitly when the state flips.
The callers no longer need cross-scope branching. The chain walk handles
shadow boundaries, and property invalidation already visits every
observer style scope.
2026-05-23 23:37:36 +02:00
..
AdoptedStyleSheetInvalidator.cpp LibWeb: Use targeted invalidation when adopting a stylesheet 2026-05-10 20:19:32 +02:00
AdoptedStyleSheetInvalidator.h LibWeb: Move adopted stylesheet invalidation into a helper 2026-04-29 15:47:23 +02:00
AncestorTraversal.h LibWeb: Use invalidation plans for pseudo-class changes 2026-05-23 23:37:36 +02:00
AttributeInvalidator.cpp LibWeb: Move attribute style invalidation into a helper 2026-04-29 15:47:23 +02:00
AttributeInvalidator.h LibWeb: Move attribute style invalidation into a helper 2026-04-29 15:47:23 +02:00
CustomElementInvalidator.cpp LibWeb: Propagate inherited style across slot boundaries 2026-05-22 09:38:59 +02:00
CustomElementInvalidator.h LibWeb: Move custom state set invalidation into the helper 2026-04-29 15:47:23 +02:00
ElementStateInvalidator.cpp LibWeb: Move shadow root style invalidation into the helper 2026-04-29 15:47:23 +02:00
ElementStateInvalidator.h LibWeb: Move shadow root style invalidation into the helper 2026-04-29 15:47:23 +02:00
EmbeddedContentInvalidator.cpp LibWeb: Move embedded content style invalidation into a helper 2026-04-29 15:47:23 +02:00
EmbeddedContentInvalidator.h LibWeb: Move embedded content style invalidation into a helper 2026-04-29 15:47:23 +02:00
FormControlInvalidator.cpp LibWeb: Move checked-state invalidation into a helper 2026-04-29 15:47:23 +02:00
FormControlInvalidator.h LibWeb: Move checked-state invalidation into a helper 2026-04-29 15:47:23 +02:00
HasMutationFeatureCollector.cpp LibWeb: Move invalidation set matching into a helper 2026-04-29 15:47:23 +02:00
HasMutationFeatureCollector.h LibWeb: Move :has() mutation checks into a helper 2026-04-29 15:47:23 +02:00
HasMutationInvalidator.cpp LibWeb: Keep shadow rule caches for user styles 2026-05-23 22:03:46 +02:00
HasMutationInvalidator.h LibWeb: Move pending :has() invalidation into the helper 2026-04-29 15:47:23 +02:00
InvalidationSetMatcher.cpp LibWeb: Invalidate shadow focus-within styles 2026-05-21 08:56:05 +02:00
InvalidationSetMatcher.h LibWeb: Move invalidation set matching into a helper 2026-04-29 15:47:23 +02:00
LanguageInvalidator.cpp LibWeb: Skip unchanged :has() mutation fanout 2026-04-30 00:24:04 +02:00
LanguageInvalidator.h LibWeb: Move text directionality invalidation into the helper 2026-04-29 15:47:23 +02:00
LinkInvalidator.cpp LibWeb: Move hyperlink style invalidation into a helper 2026-04-29 15:47:23 +02:00
LinkInvalidator.h LibWeb: Move hyperlink style invalidation into a helper 2026-04-29 15:47:23 +02:00
MediaQueryInvalidator.cpp LibWeb: Move media query style invalidation into a helper 2026-04-29 15:47:23 +02:00
MediaQueryInvalidator.h LibWeb: Move media query style invalidation into a helper 2026-04-29 15:47:23 +02:00
NodeInvalidator.cpp LibWebView: Add style invalidation counter dump option 2026-04-30 00:24:04 +02:00
NodeInvalidator.h LibWeb: Move node style invalidation into a helper 2026-04-29 15:47:23 +02:00
PartInvalidator.cpp LibWeb: Move part style invalidation into a helper 2026-04-29 15:47:23 +02:00
PartInvalidator.h LibWeb: Move part style invalidation into a helper 2026-04-29 15:47:23 +02:00
PseudoClassInvalidator.cpp LibWeb: Use invalidation plans for pseudo-class changes 2026-05-23 23:37:36 +02:00
PseudoClassInvalidator.h LibWeb: Use invalidation plans for pseudo-class changes 2026-05-23 23:37:36 +02:00
SlotInvalidator.cpp LibWeb: Propagate inherited style across slot boundaries 2026-05-22 09:38:59 +02:00
SlotInvalidator.h LibWeb: Propagate inherited style across slot boundaries 2026-05-22 09:38:59 +02:00
StructuralMutationInvalidator.cpp LibWeb: Target :first/:last/:only-child sibling invalidation precisely 2026-05-06 21:22:02 +02:00
StructuralMutationInvalidator.h LibWeb: Move structural mutation invalidation into a helper 2026-04-29 15:47:23 +02:00
StyleInvalidator.cpp LibWeb: Move StyleInvalidator into CSS invalidation 2026-04-29 15:47:23 +02:00
StyleInvalidator.h LibWeb: Move StyleInvalidator into CSS invalidation 2026-04-29 15:47:23 +02:00