Re: [css3-selectors] Valid syntax that never represents an element

On Thu, Jun 7, 2012 at 9:35 AM, Lea Verou <leaverou@gmail.com> wrote:
> I recently got into two separate unrelated discussions [1] [2] about whether
> the failing (in WebKit) :nth-*(-n-1) tests in css3test.com [3] should be
> removed, as these selectors would never match any element so it's supposedly
> OK if browsers consider it invalid syntax. Apparently the confusion arose
> from this excerpt from css3-selectors [4]: “ The value a can be negative,
> but only the positive values of an+b, for n≥0, may represent an element in
> the document tree.”. I think it’s quite obvious that throwing an error on
> such cases is non-conforming, since the syntax is perfectly valid according
> to the grammar, but thought I’d ask just in case I’m misunderstanding the
> spec in some way. If not, it might be a good idea to make it more clear in
> css4-selectors since, apparently, implementors are confused too.

Yup, Bjoern's right - considering ":nth-child(-n-1)" as an invalid
selector is definitely wrong, unless the spec actually says that's
invalid.

That said, it sounds like that sentence from the spec has an incorrect
use of MAY.

~TJ

Received on Thursday, 7 June 2012 17:48:10 UTC