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

Assuming the following stylesheet:


@import "include.css" { color: red } print;
.red { color: red; }


1) Should it include "include.css"?
2) Should it include "include.css" only for the print media type?
3) Should the @import rule be ignored completely?
4) Should elements of class "red" have red text?

Currently, I am thus far:

1: MAYBE: The rule is neither unrecognized nor misplaced [1], so it may
not be ignored. However, it cannot be parsed further starting with the
open curly brace, so its remainder is ignored up to the ending semicolon,
leaving us with
  @import "include.css"
plus the again recognized ';' since we know an @import rule ends with a
semicolon.

2: MAYBE: Same reasoning like in (1), but { ... } is not allowed in
@import. However, @import ends with a semicolon, so we skip the unknown
part between braces and pick up again after it, giving us a print media type.

3: MAYBE: It is neither unrecognized nor misplaced (-> NO), except for
when "unrecognized" means "either unknown name or not valid according to
the grammar" (-> YES). [1]

4: MAYBE: According to the rules for forming at-rules [1], the @import
rule ends after the closing brace. The remaining stylesheet is
  print; ...
whereby this is no longer parseable according to the grammar, and
therefore [1] applies, whereby we take the largest chunk of the
stylesheet to be parsed from the beginning, discarding the rest from the
place where we can no longer parse. This means the stylesheet would end
after the closing brace in @import.

Any clues?

[1] <http://www.w3.org/TR/2003/WD-css3-syntax-20030813/#at-rules>
[2] <http://www.w3.org/TR/2003/WD-css3-syntax-20030813/#error-handling>


Regards, Christian.

Received on Friday, 3 September 2004 14:57:42 UTC