Skip to content

[selectors][Editorial] Are things like :is(.foo *) still a <compound-selector>? #6737

Closed
@LeaVerou

Description

@LeaVerou

Currently there are various specs that restrict selector arguments to <compound-selector> for performance reasons. E.g. :host and :host-context().

However, given how <compound-selector> is defined, things like :is(.foo .bar *) or :not(.foo .bar *) still match its grammar:

<compound-selector> = [ <type-selector>? <subclass-selector>*
                        [ <pseudo-element-selector> <pseudo-class-selector>* ]* ]!
[...]
<pseudo-class-selector> = ':' <ident-token> |
                          ':' <function-token> <any-value> ')'

So technically, things like :host-context(:is(.foo .bar *)) should be allowed, even though they currently are not in implementations and I guess should not be. Am I missing something or do these grammars need fixing? Perhaps we need a <restricted-compound-selector> or something?

cc @tabatkins

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