Re: [selectors4][css3-syntax] an+b corner case

(12/05/01 1:23), Boris Zbarsky wrote:
> On 4/30/12 12:56 PM, Tab Atkins Jr. wrote:
> And for what it's worth, it's even worse.  To quote the Gecko source
> comments from parsing this stuff:
> 
>  // The CSS tokenization doesn't handle :nth-child() containing - well:
>  //   2n-1 is a dimension
>  //   n-1 is an identifier
> 
> (And on a personal note, I'd like to point out that "-n-5" is likewise
> an IDENT token in the tokenizer.  Yay overloading of hyphen and minus!)

Sigh.

> [pseudo code snipped]
> 
> The end result is that Gecko allows comments or whitespace _after_ the
> 'n', and in cases when the 'n' is followed by a '-' makes the behavior
> as if there had in fact been a comment or whitespace between them.  But
> no comments or whitespace before the "n" allowed: that ends up falling
> into the t.isInteger() case above.  This could probably be fixed if it
> were really necessary, but I question how necessary it is, since no UA
> actually does that.  Fixing the spec would be preferable.

Agreed. I am all for reducing unnecessary codes in browsers and I care
much less about the size of the spec. :p


I think this prose should be written to have a dependency on css3-syntax
or perhaps css3-syntax could just take over it.


Cheers,
Kenny

Received on Monday, 30 April 2012 17:53:39 UTC