[csswg-drafts] Pull Request: Allow -n in an-b, allow comments within +n and -n

Manishearth has just submitted a new pull request for https://github.com/w3c/csswg-drafts:

== Allow -n in an-b, allow comments within +n and -n ==
Currently the grammar doesn't allow for `-n` within `:nth-child`, it only deals with `+n`. However, `-n` (and things like `-n+5`) are accepted by browsers.

This fixes the discrepancy.

Additionally, the parsing here is a bit tricky -- while the `+`/`-` and `n` are separate tokens, the spec does not allow for spaces between them. Chrome follows this, and as of  https://bugzilla.mozilla.org/show_bug.cgi?id=1364009, firefox does too. However, both allow comments. While this is probably implicit, I'm clarifying this within the spec.



See also: https://github.com/servo/rust-cssparser/issues/153,


r? @tabatkins @SimonSapin

See https://github.com/w3c/csswg-drafts/pull/1498

Received on Sunday, 4 June 2017 06:59:58 UTC