ladybird/Libraries/LibWeb/CSS/Invalidation
Andreas Kling b01ce45c14 LibWeb: Guard non-subject pseudo-class invalidations
Compound selectors with a non-rightmost pseudo-class used to register
their descendant and sibling invalidation plans directly under the
pseudo-class property. A selector like `.item:hover * .target` ran
the descendant plan for every hovered element, even when that element
could not match `.item`.

Store those non-rightmost plans behind a guard made from stable class
and id subject features in the same compound selector. Deliberately
leave pseudo-classes out of guards, since one mutation can change
multiple state pseudo-classes at once. Also leave tag and attribute
selectors out, since their matching depends on document and namespace
case-sensitivity that the guard property does not carry.

The new style-invalidation test covers the GitHub-shaped
`:hover * :not(...)` case, co-invalidated `:link` and `:any-link`,
partial or complex `:is()`/`:where()` alternatives, and case-sensitive
SVG tag and attribute selectors.
2026-05-24 15:32:39 +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: Guard non-subject pseudo-class invalidations 2026-05-24 15:32:39 +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: Guard non-subject pseudo-class invalidations 2026-05-24 15:32:39 +02:00
StyleInvalidator.h LibWeb: Move StyleInvalidator into CSS invalidation 2026-04-29 15:47:23 +02:00