- From: Lea Verou via GitHub <noreply@w3.org>
- Date: Thu, 16 Apr 2026 00:30:50 +0000
- To: public-css-archive@w3.org
> > And for comparison to the slower, more verbose code one might have now:
> >
> > * today: `Array.from(document.querySelectorAll('*')).filter(n => n.shadowRoot)`
>
> Please also note that there are nested shadow DOM instances which require recursive search. e.g. [cookies.set()](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/cookies/set#browser_compatibility)
Nested shadow roots are not relevant here. `:has-shadow`, is a pseudo-class, and thus acts as a filter, and cannot *expand* the set of elements matched.
--
GitHub Notification of comment by LeaVerou
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/11007#issuecomment-4256563698 using your GitHub account
--
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Thursday, 16 April 2026 00:30:50 UTC