"@import" positional validity

Section 4.1.5, "At-rules", in the CSS 2.1 specification 
(<http://www.w3.org/TR/CSS21/syndata.html#at-rules>):

"CSS 2.1 user agents must ignore any '@import' rule that occurs inside 
a block or that doesn't precede all rule sets."

Considering the passage literally, what is the validity of the 
"@import" at-rule in the following style sheet?

@media all {}
@import url("http://example.com/style-sheet.css");

If the "@import" at-rule is valid, it seems that the specification has 
accidentally left a loophole. If the "@import" at-rule is invalid, on 
what basis is it invalid?

Section 4.1.7,  "Rule sets, declaration blocks, and selectors", in the 
CSS 2.1 specification (<http://www.w3.org/TR/CSS21/syndata.html#q10>):

"When a user agent can't parse the selector (i.e., it is not valid CSS 
2.1), it must ignore the {}-block as well."

Section 4.2, "Rules for handling parsing errors", in the CSS 2.1 
specification (<http://www.w3.org/TR/CSS21/syndata.html#ignore>):

"In some cases, user agents must ignore part of an illegal style sheet. 
This specification defines ignore to mean that the user agent parses 
the illegal part (in order to find its beginning and end), but 
otherwise acts as if it had not been there."

Considering the CSS meaning of "ignore", what is the validity of the 
"@import" at-rule in the following style sheet?

"error" {}
@import url("http://example.com/style-sheet.css");

If the "@import" at-rule is valid, it seems that the specification has 
accidentally left a loophole. If the "@import" at-rule is invalid, can 
the definition of "ignore" stand as is?

-- 
Etan Wexler.

Received on Sunday, 10 October 2004 09:53:00 UTC