Invalid at-rules with known name

Björn Höhrmann ("Bjoern Hoehrmann") wrote to <mailto:www-style@w3.org> 
on 6 October 2004 in "Re: Possible CSS2/CSS2.1/CSS3 spec error in 
@media" (<mid:41670790.536500807@smtp.bjoern.hoehrmann.de>):

> [The] generic error handling rules for illegal at-rules would apply, 
> i.e. the entire at-rule would be ignored.

Where is the specification of generic error handling for illegal 
at-rules?

I find two provisions. One is in section 4.1.5, "At-rules", in the CSS 
2.1 specification (<http://www.w3.org/TR/CSS21/syndata.html#at-rules>):

"A CSS user agent that encounters an unrecognized at-rule must ignore 
the whole of the at-rule and continue parsing after it."

The other provision, noted by Jim Wilkinson (in 
<mid:opsfistbo0brj5zx@dial81-131-132-44.in-addr.btopenworld.com>), is 
in section 4.2, "Rules for handling parsing errors", in the CSS 2.1 
specification 
(<http://www.w3.org/TR/CSS21/syndata.html#parsing-errors>):

"User agents must ignore an invalid at-keyword together with everything 
following it, up to and including the next semicolon (;) or block 
({...}), whichever comes first."

Are the passages equivalent? Does the first say something that the 
second does not?  What is "an unrecognized at-rule"?

If an unrecognized at-rule is one which has some invalid part, then the 
following at-rule must be ignored entirely.

@media screen {
   element-1 {
     font-size: 2em;
     margin: 1ex;
     error: error;
     }
   element-2 {
     border: thick;
     padding: 1ex;
     color: white;
     background: black;
     }
   }

Further, if an unrecognized at-rule is one which has some invalid part, 
then an invalid medium identifier or query would invalidate an entire 
"@media" or "@import" at-rule. But section 7.3, "Recognized media 
types", in the CSS 2.1 specification 
(<http://www.w3.org/TR/CSS21/media.html#media-types>) states:

"Unknown media type names should not result in the @media rule being 
ignored."

I would suggest amending the CSS 2.1 specification, but I understand 
that at this point the Working Group is on a full charge towards 
Recommendation status. Therefore my compromise suggestion is that the 
Working Group issue a correction once the specification achieves 
Recommendation status. I also suggest that the policy for CSS level 3 
and later be one of clear specification of error handling for each type 
of at-rule. The specification of error handling should go with the 
specification of proper grammar.

-- 
Etan Wexler.

Received on Sunday, 10 October 2004 09:52:56 UTC