[Webkit-unassigned] [Bug 233380] CSS :scope pseudo selector doesn't work in shadowRoot.querySelectorAll

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Nov 22 04:51:00 PST 2021


https://bugs.webkit.org/show_bug.cgi?id=233380

--- Comment #9 from Andrei Anischevici <andrei002 at gmail.com> ---
(In reply to Emilio Cobos Álvarez (:emilio) from comment #8)
> I think this is invalid. You can use :host > div instead, which ought to
> work per spec. I filed
> https://bugs.chromium.org/p/chromium/issues/detail?id=1272434 for Chromium.

Thank you for looking into this, Emilio!

I have just tested the ':host > div' solution that you suggested, and it does indeed accomplish the selection of direct descendants across all browsers (excluding IE, which is expected), so we have a path forward..

If :scope is indeed not supposed to be working for shadow roots, I'd suggest improving the CSS Selectors Level 4 spec, so that this is mentioned explicitly in :scope and there's no ambiguity:

"If the :scope elements are not explicitly specified, but the selector is scoped and the scoping root is an element, then :scope represents the scoping root;"

change to =>

"If the :scope elements are not explicitly specified, but the selector is scoped and the scoping root is a true (not virtual) element, then :scope represents the scoping root;"

would you agree?

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20211122/b8f695fe/attachment.htm>


More information about the webkit-unassigned mailing list