RE: Comments

Matthew Brealey writes:
> --- Bill dehOra <Wdehora@cromwellmedia.co.uk> wrote:
> > 
> >    :  Given that
> >    :  P {colour: red /* comment */}
> >    :  isn't valid, should the declaration (i.e.,
> > color: red)
> >    :  be ignored as invalid?
> >    
> > 
> > If you are referring to the comment placement, why
> > isn't this valid? A
> > comment can appear anywhere between tokens; here it
> > appears between
> > <whitespace> and a <}>, which are both tokens (in
> > CSS2 at least).  
> 
> No no no.
> 
> When you refer to <whitespace>, I presume you mean the
> S token. 
> 
> However, } isn't a token at all.

Hmm, that is rather a narrow interpretation of "token"...

The only reason '}' isn't spelled "RBRACE" is that the former is
shorter. When the spec says "comments [...] may occur anywhere between
tokens" it certainly intends '}' to be a token. In fact, if you look
at 4.1.1[1], you see that '}' is explicitly listed as a token.

[1] http://www.w3.org/TR/REC-CSS2/syndata.html#tokenization



Bert
-- 
  Bert Bos                                ( W 3 C ) http://www.w3.org/
  http://www.w3.org/people/bos/                              W3C/INRIA
  bert@w3.org                             2004 Rt des Lucioles / BP 93
  +33 (0)4 92 38 76 92            06902 Sophia Antipolis Cedex, France

Received on Tuesday, 14 December 1999 10:33:38 UTC