W3C home > Mailing lists > Public > www-style@w3.org > February 2009

Re: Issue in CSS21 grammar?

From: Germain Garand <germain@ebooksfrance.org>
Date: Tue, 10 Feb 2009 14:53:50 +0100
To: Yves Lafon <ylafon@w3.org>
Cc: www-style@w3.org
Message-Id: <200902101453.50717.germain@ebooksfrance.org>

Le mardi 10 février 2009, vous avez écrit :
> I completely agree that a grammar is not the place to enforce all the
> special cases of the specification, there are constraints that can't
> be expressed in the grammar, but in this specific case, I can't imagine a
> selector being a HASH and not a HASHIDENT (as specified by '#' IDENT )
>
> If HASHIDENT is not needed, then IDENT is not needed, and we should move
> all the IDENT to NAME and put the constraint in the text of the spec :)
> Cheers,

isn't the problem the other way around, that HASH is also used for tokenizing 
of hexadecimal colors, which can't match IDENT?

in KHTML, we resorted to contextual tokenizing to solve this ambiguity:

#ff0000 { color: #00ff00; }
#00ff00 { color: #ff0000; } /* invalid selector */

I believe some engines are still affected by a side effect of this:

 <span style='color:#red'>Should not be red.


Greetings,
Germain
Received on Tuesday, 10 February 2009 13:55:10 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:16 GMT