W3C home > Mailing lists > Public > www-style@w3.org > May 2008

[CSS21] parsing invalid syntax and matching brackets

From: fantasai <fantasai.lists@inkedblade.net>
Date: Wed, 21 May 2008 00:20:58 -0700
Message-ID: <4833CD5A.7010002@inkedblade.net>
To: www-style@w3.org, Justin Rogers <justrog@microsoft.com>

   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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:55:06 GMT