Files
ladybird/Libraries/LibWeb/CSS/StyleInvalidationData.cpp
Aliaksandr Kalenik f2cd23659c LibWeb: Fix :has() invalidation with nested :is() selectors
Replace the broad whole-subtree fallback for :has() invalidation with
a more targeted approach. The old code unconditionally overwrote
fine-grained :has() invalidation plans with invalidate_whole_subtree
for every non-rightmost compound containing :has(). This prevented
optimization for direct cases like `.a:has(.b) .c`.

The new approach propagates pseudo_class:Has through :is()/:where()
argument processing when :has() appears in non-rightmost compounds of
the inner selector. For complex :is() arguments (multiple compounds),
it falls back to whole-subtree invalidation since the outer plan can't
correctly capture the nested combinator structure.
2026-03-10 17:56:42 +01:00

19 KiB