Skip to content

[selectors] The grammar for :host() and other compound-selector-taking things should probably forbid pseudo-elements #3963

Open
@emilio

Description

@emilio

I just realized that WebKit (but not Blink nor Gecko) parse the following selector as valid:

:host(::before)

(or :host(::before)::before for that matter).

I was going to file a WebKit bug, but then realized that the grammar technically allows it. This also applies to the grammar of :is / :where (old :matches) etc.

I think that's wrong and pseudo-elements should not be allowed in nested selectors. WebKit itself doesn't parse, e.g., :not(::before), so they're not consistent about it.

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