Skip to content

[css-cascade-6] Tree-crossing @scope #12555

@andruud

Description

@andruud

The current definition of in scope requires an element to be an 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions