Skip to content

[selectors-4] :nth-child and friends are either underdefined or defined wrong #1292

@SimonSapin

Description

@SimonSapin

All of these

have a definition that includes “the An+Bth element” with no details on what that means. This is either wrong (since this is using “the element” singular, where as multiple elements could match) or at least under-defined. A and B are from https://drafts.csswg.org/css-syntax/#anb, but what is n?

This is a regression from Selectors Level 3, which has a precise definition:

https://drafts.csswg.org/selectors-3/#nth-child-pseudo

The :nth-child(an+b) pseudo-class notation represents an element that has an+b-1 siblings before it in the document tree, for any positive integer or zero value of n, and has a parent element.

Notable edge cases that should be well-defined include n<0 and A=0.

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