[csswg-drafts] [css-cascade-6] Tree-crossing @scope (#12555)

andruud has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-cascade-6] Tree-crossing @scope ==
The current definition of [in scope](https://drafts.csswg.org/css-cascade-6/#in-scope ) requires an element to be an [inclusive descendant](https://dom.spec.whatwg.org/#concept-tree-inclusive-descendant) of the scoping root. This means an element must be in the same tree as the scoping root to be "in scope":

```
@scope (#somehost) {
  :scope::part(p) { } /* Can never match */
}
```

However, browsers don't match the spec at the moment: https://wpt.fyi/results/css/css-cascade/scope-part.html?label=master&label=experimental&aligned&view=interop&q=label%3Ainterop-2025-scope

We don't behave consistently for all tree-crossing stuff; `::slotted()` cases aren't working, at least not in Chrome and Firefox.

The question is, should we change WPTs/browers, or should we change the definition of what "in scope" means in the spec? cc @dshin-moz, @mdubet 

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/12555 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 31 July 2025 09:35:31 UTC