Re: [CSS21] DELIM? in core syntax

Anne van Kesteren wrote:
 > It's not just * that does that:
 >
 > http://annevankesteren.nl/2007/02/ie7-css-hacks

Well, okay. But I'm not aware of a corpus of actual usage for the other
characters. Would you suggest those should be handled the same way?

 > Actually, the core syntax does not deal with that.
 >
 > body { * ; color:lime }
 >
 > for instance does not match the core syntax either and is still
 > parsed as if
 >
 > body { color:lime }
 >
 > was specified.

Parsed how? (That is according to rules defined where and with what scope?)

 > The malformed declaration entry in
 >
 > http://www.w3.org/TR/CSS21/syndata.html#parsing-errors
 >
 > takes care of handling that correctly.

I think we're understand the spec differently:

http://www.w3.org/TR/CSS21/syndata.html:
 > This section describes a grammar (and forward-compatible parsing
 > rules) common to any level of CSS (including CSS 2.1). Future updates of
 > CSS will adhere to this core syntax, although they may add additional
 > syntactic constraints.
 >
 > [snip]
 >
 > Below is the core syntax for CSS. The sections that follow describe
 > how to use it. Appendix G describes a more restrictive grammar that is
 > closer to the CSS level 2 language. Parts of style sheets that can be
 > parsed according to this grammar but not according to the grammar in
 > Appendix G are among the parts that will be ignored according to the
 > rules for handling parsing errors.
 >
 > [snip]
 >
 > The meaning of input that cannot be tokenized or parsed is undefined
 > in CSS 2.1.

And then http://www.w3.org/TR/CSS21/syndata.html#parsing-errors says:
 > In some cases, user agents must ignore part of an illegal style
 > sheet. This specification defines ignore to mean that the user agent
 > parses the illegal part (in order to find its beginning and end), but
 > otherwise acts as if it had not been there.

It seems to me ignoring something is equivalent to defining it as having 
no meaning (at least to the CSS 2.1-conforming implementation).

So maybe I've misunderstood the intention, but as I read it the defined 
error parsing rules do not apply to input (i.e. stylesheets) that can't 
be parsed with the core grammar. Malformed declarations are those which 
can be parsed with the core grammar but not the CSS 2.1 grammar.

If this is not the case, it would be super if the spec were made a bit 
clearer, as that represents my current best guess at what the spec intends.

--
Benjamin Hawkes-Lewis

Received on Saturday, 5 April 2008 13:13:00 UTC