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>

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

   # 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).

That would extend the pairs-matching rules to all constructs in the style
sheet. I hope this matches the behavior Justin Rogers proposes in

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

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