Re: [CSS 2.1] @charset, @import, and error recovery

On Saturday 2008-01-26 14:59 -0800, Justin Rogers wrote:
> "Any @import rules must precede all other rules (except the @charset rule, if present)."
> 
> Well that is clear. NO other rules are allowed, but what about failed rules? Rules that don't make sense:

I've always assumed that unknown or invalid rules don't count for
this.  I think that's probably the most useful behavior for
forward-compatibility.

I think it's also reasonably clear in the spec, which says the
following (note "valid"):
# CSS 2.1 user agents must ignore any '@import' rule that occurs
# inside a block or after any valid statement other than an @charset
# or an @import rule.
-- http://www.w3.org/TR/2007/CR-CSS21-20070719/syndata.html#at-rules

I think it's also what Ian tests in test 61c in
http://hixie.ch/tests/evil/css/import/extra/importafterimport.html
which is part of http://hixie.ch/tests/evil/css/import/ .

> Browsers are inconsistent here.

How?

-David

-- 
L. David Baron                                 http://dbaron.org/
Mozilla Corporation                       http://www.mozilla.com/

Received on Sunday, 27 January 2008 00:42:42 UTC