mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-10 17:12:41 +02:00
When matching selectors like `:host ::slotted(div)`, the selector engine needs to traverse up from the slot element to reach the shadow host for `:host` matching. Previously, we passed shadow_host_to_use which was derived from the *slotted element's* DOM position. For elements in the light DOM (not inside any shadow root), this was null, causing traverse_up() to use parent() instead of parent_or_shadow_host_element(). This meant the traversal could never cross the shadow boundary from inside the shadow tree to reach the host element. Fix this by deriving the shadow host from the slot's containing shadow root, which is the correct scope for combinator traversal within ::slotted() rule matching.
150 KiB
150 KiB