ladybird/Libraries/LibWeb/CSS/Invalidation
Andreas Kling c746bd5049 LibWeb: Avoid needless :has() descendant fanout
When an element was affected by :has() in subject position,
pending :has() mutation invalidation also applied the pseudo-class
invalidation plan for that element. If the same element had ever been
observed in a non-subject :has() selector, that plan could invalidate
the element's whole descendant subtree even when the mutation could
only require the subject element itself to recompute style.

Keep subject-position :has() invalidation to the element itself, and
run the descendant fanout only for non-subject involvement after the
existing mutation feature filter says that fanout may be affected.
Track the strongest invalidation applied to each anchor, so a later
batched mutation can still upgrade earlier anchor-only work to a
descendant fanout.

Extend the filter to treat known state pseudo-classes as concrete
mutation features, so a :hover mutation does not conservatively match
unrelated selectors such as :has(dialog:modal).

Scope boundary selectors are kept conservative where needed: when an
@scope boundary contains :has(), the scope root's match can activate or
deactivate style rules for descendants, so it still records descendant
involvement.

Add coverage for unrelated hover and batched mutation cases on elements
whose ancestors have both subject and non-subject :has() involvement,
ensuring descendant no-op recomputation stays bounded without dropping
required descendant fanout.
2026-06-08 17:16:18 +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: Avoid needless :has() descendant fanout 2026-06-08 17:16:18 +02:00
HasMutationInvalidator.h LibWeb: Avoid needless :has() descendant fanout 2026-06-08 17:16:18 +02:00
InvalidationSetMatcher.cpp LibWeb: Guard pseudo-class invalidation by selector features 2026-06-08 17:16:18 +02:00
InvalidationSetMatcher.h LibWeb: Narrow pseudo-class self invalidation 2026-05-30 02:13: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: Target media query change invalidation 2026-05-25 19:18:10 +02:00
MediaQueryInvalidator.h LibWeb: Move media query style invalidation into a helper 2026-04-29 15:47:23 +02:00
NodeInvalidator.cpp LibWeb: Narrow pseudo-class self invalidation 2026-05-30 02:13:23 +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: Narrow pseudo-class self invalidation 2026-05-30 02:13:23 +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: Avoid sibling walks for last-child invalidation 2026-06-08 17:16:18 +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