Files
ladybird/Libraries/LibWeb/DOM/Node.cpp
Andreas Kling 60113a3be2 LibWeb: Schedule attribute :has() walks on enclosing shadow scopes
The property-based Node::invalidate_style only collected the element's
own shadow scope (when the element itself was a shadow host), not the
shadow scopes of enclosing hosts. So a class or attribute change on a
light-DOM descendant of a shadow host could not flip
:host(...:has(.descendant)) rules in that host's shadow root.

Walk parent_or_shadow_host from the mutated element and add every
enclosing shadow root's StyleScope to the set we check :has()
metadata against, schedule walks on, and run invalidation plans
through.
2026-04-26 10:40:58 +02:00

163 KiB