Skip to content

[css-selectors-4] Syntax order of <pseudo-compound-selectors> #10165

@pyoor

Description

@pyoor

Currently the syntax for pseudo-compound-selectors is defined as:

<dfn>&lt;pseudo-compound-selector></dfn> = <<pseudo-element-selector>> <<pseudo-class-selector>>*

However, according to the following note, pseudo-elements rarely follow pseudo-classes and the inverse is more often true.

[In general, a <pseudo-element-selector> is only valid if placed at the end of the last <compound-selector> in a <complex-selector>. In some circumstances, however, it can be followed by more s or <pseudo-class-selector>s; but these are specified on a case-by-case basis. (For example, the user action pseudo-classes are allowed after any pseudo-element, and the tree-abiding pseudo-elements are allowed after the ::slotted() pseudo-element.)](

Note: In general,
a <<pseudo-element-selector>> is only valid
if placed at the end of the last <<compound-selector>>
in a <<complex-selector>>.
In some circumstances, however,
it can be followed by more <<pseudo-element-selector>>s or <<pseudo-class-selector>>s;
but these are specified on a case-by-case basis.
(For example, the <a>user action pseudo-classes</a> are allowed after any <a>pseudo-element</a>,
and the <a>tree-abiding pseudo-elements</a>
are allowed after the ''::slotted()'' pseudo-element.)
)

Shouldn't the syntax of pseudo-compound-selectors be changed to reflect this? Or, should the syntax be changed to use && combinator to denote that they may appear in any order?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Closed as Question AnsweredUsed when the issue is more of a question than a problem, and it's been answered.selectors-4Current Work

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions