[csswg-drafts] [selectors] nth-child omits n=0 case

fergald has just created a new issue for https://github.com/w3c/csswg-drafts:

== [selectors] nth-child omits n=0 case ==
https://drafts.csswg.org/selectors-4/#the-nth-child-pseudo

"The An+B notation and its interpretation are defined in CSS Syntax 3 ยง6 The An+B microsyntax; it represents any index i = An + B for any positive integer n."

So e.g. 2n+1 would not match the 1st child.

The link is to

https://drafts.csswg.org/css-syntax-3/#anb-microsyntax

"The An+B notation defines an integer step (A) and offset (B), and represents the An+Bth elements in a list, for every positive integer or zero value of n, with the first element in the list having index 1 (not 0)."

The spec should mention the zero case (and probably also that the list is 1-indexed).

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2321 using your GitHub account

Received on Friday, 16 February 2018 05:18:45 UTC