LibWeb: Narrow :has descendant invalidation fanout

When a :has() mutation is known to come from a specific subtree, use
that subtree as the mutation root while walking observed ancestors.

Before dirtying an anchor and its non-subject descendants, check whether
any cached :has() rule for that anchor can observe the changed subtree.
This keeps unrelated descendant mutations from invalidating every rule
that merely contains :has().
This commit is contained in:
Andreas Kling
2026-04-27 10:06:35 +02:00
committed by Andreas Kling
parent 356a369aa6
commit ce5d0bdfc7
Notes: github-actions[bot] 2026-04-28 13:35:54 +00:00
29 changed files with 2125 additions and 1748 deletions

View File

@@ -419,6 +419,7 @@ void build_invalidation_sets_for_simple_selector(Selector::SimpleSelector const&
case PseudoClass::Enabled:
case PseudoClass::Defined:
case PseudoClass::Disabled:
case PseudoClass::Empty:
case PseudoClass::PlaceholderShown:
case PseudoClass::Checked:
case PseudoClass::Has: {