Re: [css3-selectors] :nth-child() argument and comments

Le 23/03/10 21:50, L. David Baron a écrit :

> I think the general precedent in CSS has been that comments are
> allowed anywhere between tokens.  (It's not a very good strategy for
> building an object model that contains comments, which is required
> for editing, but it's the one we have.)  That's actually somewhat
> hard-coded into our tokenizer.
>
> I think Gecko allows comments in other places inside :nth-child(),
> (including everywhere that whitespace is allowed) but not in the one
> above, since we only accept the '2n' as a dimension token (though we
> could change that).

Side note independant of my proposal, Gecko is buggy if comments are
allowed inside 2n+1.

> I'm a little bit uncomfortable disallowing comments in places where
> we allow whitespace.
>
>
> It's probably somewhat easier for us to switch for allowing comments
> in more places (i.e., accepting the example above) than to switch to
> allowing them in fewer, but it's probably doable with some amount of
> work.

I find it really ugly to allow comments here but I am more concerned
by the complexity of the parsing

   :nth-child( 3 /* this is 3 because blabla */
               n /* multiplicator */
               + /* we want the 1, 4, 7, ... */
               1 )

   :nth-child ( - /* blabla */
                2n+10 )

Anyway, whatever the conclusion, I can live with it. But we
needed to clarify this. We really never thought of comments inside an+b.

</Daniel>

Received on Tuesday, 23 March 2010 21:42:42 UTC