W3C home > Mailing lists > Public > www-style@w3.org > October 2004

Re: [css3-syntax] Error handling within known at-rules

From: Christian Roth <roth@visualclick.de>
Date: Mon, 11 Oct 2004 11:48:07 +0200
To: "www-style Mailing List" <www-style@w3.org>
Message-Id: <20041011104807.31277@mail.visualclick.de>

Etan Wexler wrote:

> On Fri, 3 Sep 2004, Christian Roth wrote:
>> Assuming the following stylesheet:
>> @import "include.css" { color: red } print;
>> .red { color: red; }
>My interpretation is that the sheet consists of:
>1. An invalid and ignorable at-rule: @import "include.css" { color: red 
>2. Ill-formed, invalid, ignorable inter-rule junk: print;
>3. A valid rule set: .red { color: red; }

As to 2. : Where is defined in the spec what ill-formed, invalid,
ignorable inter-rule junk is? CSS21 4.1.4 [1] states:

"A CSS style sheet, for any version of CSS, consists of a list of
statements (see the grammar above). There are two kinds of statements:
at-rules and rule sets."

Stylesheets (note the "any version" clause) consist of two types of
rules: at-rules and rule sets. 

"print;" must be the start of a rule-set since obviously, it isn't an at-
rule. This means that "print; .red" is to be considered the selector part
[2], "{ color: red; }" the respective declaration-block.

Now, since "print; .red" cannot be parsed as a selector, the following
requirement holds true [2]:

"When a user agent can't parse the selector (i.e., it is not valid
CSS 2.1), it must ignore the {}-block as well."

This leaves us with the only possible interpretation of the resulting
stylesheet as the empty stylesheet (see also the same interpretation by
Ian Hickson, [3]). 

(This implies, btw., that the W3C CSS Validator does not follow the spec
here - already reported).

[1] <http://www.w3.org/TR/CSS21/syndata.html#q7>
[2] <http://www.w3.org/TR/CSS21/syndata.html#q10>
[3] <http://www.w3.org/mid/Pine.LNX.4

Regards, Christian.
Received on Monday, 11 October 2004 09:48:49 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:15 UTC