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

Re: [CSS21] DELIM? in core syntax

From: Benjamin Hawkes-Lewis <bhawkeslewis@googlemail.com>
Date: Sat, 05 Apr 2008 14:12:23 +0100
Message-ID: <47F77AB7.1060600@googlemail.com>
To: Anne van Kesteren <annevk@opera.com>
CC: fantasai <fantasai.lists@inkedblade.net>, www-style@w3.org

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 GMT

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