W3C home > Mailing lists > Public > www-style@w3.org > December 2002

Re: CSS parser recovery

From: Ian Hickson <ian@hixie.ch>
Date: Fri, 13 Dec 2002 19:00:54 +0000 (GMT)
To: "REFSTRUP,JACOB (HP-Vancouver,ex1)" <jacob_refstrup@hp.com>
Cc: "www-style (E-mail)" <www-style@w3.org>
Message-ID: <Pine.LNX.4.21.0212131853190.21095-100000@dhalsim.dreamhost.com>

On Fri, 13 Dec 2002, REFSTRUP,JACOB (HP-Vancouver,ex1) wrote:
> p {color: green; /* missing "}" */
> q {color: blue;}
> samp {color:red;}

That should parse as something like (froom memory):

   Selector: p
       Property: 'color'
       Value: 'green'
     Ignored Declaration:
       Comment: ' missing "}" '
       Property: 'q'       
         Identifier: 'color'
         Token: ':'
         Identifier: 'blue'
       Identifier: 'samp'
         Identifier: 'color'
         Token: ':'
         Identifier: 'red'
   Error: Unexpected EOF (Expected '}')

...and therefore is equivalent to the following stylesheet:

   p { color: green }

The bit from the comment to the end is definitely ignored as being an
unrecognised syntax for a declaration. The spec is extremely clear about
this, I think.

The bit I'm not clear about is whether 'q' gets treated as an identifier
or a property. I think I may be mixing two parts of the parsing process,
and that it would start of as an identifier and then be considered as a
property only if the syntax for that declaration was correct? I'm not
sure. David can probably tell us...

Ian Hickson                                      )\._.,--....,'``.    fL
"meow"                                          /,   _.. \   _\  ;`._ ,.
http://index.hixie.ch/                         `._.-(,_..'--(,_..'`-.;.'
Received on Friday, 13 December 2002 14:00:56 UTC

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