Skip to content

[selectors-4] Clarify how to parse S in <:nth-child()> #7398

@cdoublev

Description

@cdoublev

The value definitions of <:nth-child()> and <:nth-last-child()> includes S defined as a <compound-selector-list> parsed as a forgiving selector list. But the first step of parsing as a forgiving selector list is:

  1. Parse a list of <complex-selector>s from input, and let selector list be the result.

I assume that :nth-child(odd of ul > li) should be invalid because ul > li is a <complex-selector>, but :nth-child(odd of li.foo, li.bar) is valid because li.foo, li.bar is a <compound-selector-list>.

I guess that this situation comes from the resolution and the commits mentionned in #1292 and #3760.

I suggest to replace S by <forgiving-compound-selector-list> and to define it as <forgiving-compound-selector-list> is identical to <forgiving-selector-list>, except it parses its components as <compound-selector> rather than <complex-selector>. Selectors 5 can replace <forgiving-compound-selector-list> by <forgiving-selector-list> if <complex-selector>s become valid.

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