[CSS21] parsing invalid syntax and matching brackets

   http://csswg.inkedblade.net/spec/css2.1#issue-24
CSS2.1 issue 24 questions whether the brackets-and-quotes-matching rules
should apply to everything or just to declarations within a declaration
block. I feel very strongly that they should apply to everything and be
the highest-priority rule for parsing. Without such a rule, new and old
implementations will scope blocks such as @media blocks differently. A
new implementation parsing an invalid statement could follow rules that
end the block early and while older implementations eat until the end
of the style sheet looking for a matching bracket.

My proposal would be to change the first three instances of "declaration"
in the malformed declaration rule in 4.2

http://www.w3.org/TR/CSS21/syndata.html#parsing-errors
   # Malformed declarations. User agents must handle unexpected tokens
   # encountered while parsing a declaration by reading until the end
   # of the declaration, while observing the rules for matching pairs
   # of (), [], {}, "", and '', and correctly handling escapes.

to "statement" (which is defined in 4.1.4).
   http://www.w3.org/TR/CSS21/syndata.html#statements

That would extend the pairs-matching rules to all constructs in the style
sheet. I hope this matches the behavior Justin Rogers proposes in
   http://lists.w3.org/Archives/Public/www-style/2008Mar/0096.html

~fantasai

Received on Wednesday, 21 May 2008 07:21:43 UTC