W3C home > Mailing lists > Public > www-style@w3.org > March 2008

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

From: Daniel Glazman <daniel.glazman@disruptive-innovations.com>
Date: Sun, 09 Mar 2008 20:51:43 +0100
Message-ID: <47D43FCF.9000201@disruptive-innovations.com>
To: www-style@w3.org

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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:55:02 GMT