[CSS21] Chapter 4: Syntax - comments/ambiguities

S4.1.5 At-rules
---------------
Ref: <http://www.w3.org/TR/CSS21/syndata.html#at-rules>

# An at-rule consists of everything up to and including 
# the next semicolon (;) or the next block, whichever comes first.

This prose is incomplete: It does not specify whether parentheses and
brackets need to be treated in pairs or not for determining the at-rule
end criteria. I'm suggesting to change the wording to:

| An at-rule consists of everything up to and including 
| the next top-level semicolon (;) or the next top-level 
| block, whichever comes first. Parentheses (( )), brackets ([ ]) 
| and braces ({ }) must always occur in matching pairs and may be nested. 


Further,

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

What does "unrecognized" mean? Suppose the rule reads 

  @import myident { someblock; }

Is this an unrecognized rule? @import is _recognized_ as being an at-
import rule due to the specific ATKEYWORD, it's just that it doesn't
follow the known and defined @import rule structure, i.e. it cannot be
parsed. Since this case is not handled by S4.2, case "Invalid at-
keywords" (since the keyword actually is valid), I'm suggesting to use
the following wording:

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


S4.1.7 Rule sets, declaration blocks, and selectors
---------------------------------------------------
Ref: <http://www.w3.org/TR/CSS21/syndata.html#q10>

# The selector (see also the section on selectors) consists 
# of everything up to (but not including) the first left curly 
# brace ({).

Again, this is insufficient, as it does not specify whether parentheses
and brackets need to occur in pairs. Suggested wording:

| The selector (see also the section on selectors) consists 
| of everything up to (but not including) the first top-level 
| left curly brace ({). Parentheses (( )), brackets ([ ]) 
| and braces ({ }) must always occur in matching pairs and may be nested.


Kind regards,
Christian

Received on Friday, 17 September 2004 14:15:39 UTC