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

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

From: Christian Roth <roth@visualclick.de>
Date: Fri, 3 Sep 2004 16:57:00 +0200
To: "www-style Mailing List" <www-style@w3.org>
Message-Id: <20040903155700.3541@mail.visualclick.de>

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

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

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