- From: Guillaume via GitHub <noreply@w3.org>
- Date: Sun, 22 Feb 2026 20:39:46 +0000
- To: public-css-archive@w3.org
cdoublev has just created a new issue for https://github.com/w3c/csswg-drafts: == [selectors-4][css-cascade-6] Conflicting definitions of "scope" and "in scope" == Selectors 4 seems to exclude scoping roots, while CSS Cascade 6 includes them. > An element is **in scope** if: It is an [inclusive descendant](https://dom.spec.whatwg.org/#concept-tree-inclusive-descendant) of the scoping root https://drafts.csswg.org/css-cascade-6/#in-scope > When a selector is scoped, it matches an element only if the element is a descendant of the scoping root. https://drafts.csswg.org/selectors-4/#scoped-selector Unless a scoped selector can match an element that is not *in scope*? 🤔 I also note that [matching a selector against a tree](https://drafts.csswg.org/selectors-4/#match-a-selector-against-a-tree) requires excluding elements _that are not descendants of at least one scoping root_, e.g. the node target on which `querySelector()` is invoked. Perhaps it should not exclude them, and the definition in HTML should invoke this algorithm with the children of the node on which `querySelector()` was invoked as the scoping roots, with a flag to _not_ include any shadow root? Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/13545 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Sunday, 22 February 2026 20:39:50 UTC