Re: [css3-selectors] whitespace inside :nth-child(an+b)?

L. David Baron wrote:

> One problem is that you can't really make use of the existing CSS
> tokenization for :nth-child(3n-1), since "3n-1" is unfortunately a
> dimension with "3" as the number and "n-1" as the unit.  (Your patch
> didn't handle any of the xn-b cases.)

Argll. Right that was a bug in my code, I forgot "n-1" is a valid
unit name, it's an ident.

> I also don't think it makes much sense to authors to allow
> whitespace before the +/- but not after it, since it *acts* like an
> arithmetic operator, so I'd prefer the rules match for both side.
> (In Mozilla's recursive descent parser, it should just be an extra
> five lines of code to handle that case if we allowed whitespace on
> both sides.)
> 
> The other problem is that it doesn't seem to be what anybody has
> implemented.  But it hasn't been implemented for very long anywhere,
> so I'm not sure how much that matters if implementers can change.

So if we look at existing functional pseudos in CSS 2.1, whitespaces are
allowed everywhere between tokens, right ? So we have two choices here
(a) we disallow whitespace entirely inside "an+b" or we allow it
everywhere.

</Daniel>

Received on Sunday, 9 March 2008 19:52:00 UTC