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

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

From: Etan Wexler <ewexler@stickdog.com>
Date: Sun, 10 Oct 2004 02:55:33 -0700
To: www-style@w3.org
Message-Id: <871EC306-1AA2-11D9-8B61-000502CB1B77@stickdog.com>

Ian Hickson wrote to <mailto:www-style@w3.org> on 4 September 2004 in 
"Re: [css3-syntax] Error handling within known at-rules" 
(<mid:Pine.LNX.4.61.0409041120230.9548@dhalsim.dreamhost.com>):

> On Fri, 3 Sep 2004, Christian Roth wrote:
>>
>> Assuming the following stylesheet:
>>
>> @import "include.css" { color: red } print;
>> .red { color: red; }
>>
>> 1) Should it include "include.css"?
>
> No.

Agreed.

>> 2) Should it include "include.css" only for the print media type?
>
> No.

Agreed.

>> 3) Should the @import rule be ignored completely?
>
> Yes.

Agreed.

>> 4) Should elements of class "red" have red text?
>
> No.

Here I would say "yes". I explain a bit later.

> The rule uses invalid syntax and thus must be ignored.
>
> The rule consists of exactly:
>
>    @import "include.css" { color: red }
>
> ...no more, no less. That's not valid.

It's not just invalid; it's incomprehensible according to what we know 
of @import at-rules. Consider the following example.

     @import url("imported") print, not-valid;

That's not valid either, because there is no medium associated with the 
keyword 'not-valid'. However, the user agent should not ignore the 
whole at-rule. The comma represents logical "or", so the lack of 
knowledge of 'not-valid' is irrelevant. The user agent should ignore 
the unknown medium specification and proceed as usual, importing the 
referenced style sheet for use in print.

> My interpretation is that the sheet consists of:
>
> 1. An invalid @rule: @import "include.css" { color: red }
> 2. An invalid rule: print; .red { color: red; }
>
> Both are dropped.

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; }

I don't have a strong preference for my interpretation over Ian's.

Beyond Christian's illuminating example lie questions of how to handle 
many kinds of syntactic errors in at-rules.

-- 
Etan Wexler.
Received on Sunday, 10 October 2004 09:58:36 GMT

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