Skip to content

[css-scoping-1][css-shadow-parts-1] Can the non-functional :host be compound? And should ::part() select within its own shadow root? #9981

@knowler

Description

@knowler

Currently in all browsers, within a shadow root, a selector such as :host::part(something) will select parts within that same shadow root. I’m curious if this is intentional as I cannot tell from the spec that the non-functional :host pseudo-class can be a compound selector like this. Admittedly, this is a nicer API than using an attribute selector, so I am happy if that’s the case. Further, in Firefox, a selector like ::part(something) on its own within a shadow root can select parts within the same shadow root. This seems maybe a bit problematic since then it could select parts within two shadow roots at the same time (e.g. a nested shadow root as well).

Demo for each case mentioned

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions