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

On Thu, Jun 7, 2012 at 1:07 PM, Kang-Hao (Kenny) Lu
<kennyluck@csail.mit.edu> wrote:
> (12/06/08 1:40), Tab Atkins Jr. wrote:
>> Yup, Bjoern's right - considering ":nth-child(-n-1)" as an invalid
>> selector is definitely wrong, unless the spec actually says that's
>> invalid.
>
> (12/06/08 0:35), Lea Verou wrote:
>> 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,
>
> The spec here is contradictory. The formal grammar says :nth-*() can't
> have IDENT in it[1], while there's also a sentence
>
>  # When a=1, or a=-1, the 1 may be omitted from the rule.
>
> . "-n-1" is an IDENT.
>
>
> The spec can't really provide a guideline for this case.

The formal grammar is multiple kinds of broken.  It simply can't be
relied on.  It'll be fixed.

~TJ

Received on Thursday, 7 June 2012 20:24:22 UTC