Skip to content

[css-scoping] :scope > * matches nothing in shadow trees #11188

@andruud

Description

@andruud

In #7261 (cc @emilio), @tabatkins concludes that:

myshadowroot.querySelector(":scope > *") returns all the root nodes in the shadow tree.

But no it doesn't: in the context of a shadow tree, the shadow root is specified to be replaced by the shadow host for the purposes of selector matching. This means that the node :scope represents here doesn't exist as far as selector matching is concerned. https://drafts.csswg.org/css-scoping-1/#host-element-in-tree

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions