Re: CSS parser recovery

Tantek Çelik wrote to <www-style@w3.org> on 23 December 2002 in "CSS
parser recovery" (<mid:BA204E97.1BB22%25tantek@cs.stanford.edu>):

> On 12/14/02 2:01 AM, "Ian Hickson" <ian@hixie.ch> wrote:

>> [...] You have not shown any part of the spec that says that the
>> brace should be ignored,

> It causes the declaration to become illegal (per the property : value
> definition of declaration), and thus the declaration is ignored.

I must disagree.  I reproduce the example in question for ease of
reference: 

p {color: green; /* missing "}" */
q {color: blue;}
samp {color:red;}

The second left curly bracket (U+007B) does not fit into CSS syntax,
not even in the core grammar.  We can ignore a declaration as invalid
only if we can parse it as a declaration in the first place.  Parsing
as a declaration means following the 'declaration' production in the
core grammar.  The string "q " makes a fine start on that production,
matching the 'property' production.     

Then the left curly bracket ruins everything.

The example does not match the core grammar and so the example is not
CSS and so user agents are free to exhibit any behavior regarding the
example.  

-- 
Etan Wexler <mailto:ewexler@stickdog.com>

Received on Wednesday, 25 December 2002 05:35:01 UTC