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

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Nov 20 12:13:13 PST 2021


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

--- Comment #6 from Andrei Anischevici <andrei002 at gmail.com> ---
Additionally, in the "Matching Selectors Against Shadow Trees" section of the Scoping spec at https://drafts.csswg.org/css-scoping/#selectors-data-model
there's this note:

"When a selector is matched against a tree, its tree context is the root of the root elements passed to the algorithm. If the tree context is a shadow root, that selector is being matched in the context of a shadow tree.

For example, any selector in a stylesheet embedded in or linked from an element in a shadow tree is in the context of a shadow tree. So is the argument to querySelector() when called from a shadow root."

Since the selector containing ":scope" is being matched in the context of the shadow tree, as specified here, it is expected that ":scope" would resolve to the shadow root, and not to the document root.

-- 
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/20211120/54ba4f9f/attachment.htm>


More information about the webkit-unassigned mailing list