W3C home > Mailing lists > Public > www-validator-css@w3.org > March 2008

Re: Malformed declarations incorrectly parsed?

From: Yves Lafon <ylafon@w3.org>
Date: Mon, 17 Mar 2008 10:04:32 -0400 (EDT)
To: Benjamin Hawkes-Lewis <bhawkeslewis@googlemail.com>
Cc: www-validator-css@w3.org
Message-ID: <Pine.LNX.4.64.0803170958030.23007@ubzre.j3.bet>

On Sat, 15 Mar 2008, Benjamin Hawkes-Lewis wrote:

> Yves Lafon wrote:
>> The tool is consistent... but it depends on the error case. Lexical errors 
>> are handled with a skip to matching brace,
>
> That doesn't appear to be true.
>
> p { color:red; color:; color:green }
>
> includes a lexical error since "color:;" cannot be parsed as "property ':' S* 
> expr prio?" from:
>
> http://www.w3.org/TR/CSS21/grammar.html#scanner
>
> The validator calls it a "parse error".
>
> If what you were saying were true, the validator would skip to the matching 
> brace, but instead it reports color: green; as valid CSS information.
>
>> Clearly, "skip to matching brace" is useful to recover, but not in line 
>> with the error recovery scheme of the CSS21 spec.
>
> I can see the utility of having no error recovery and I can see the utility 
> of having the error recovery mandated by the spec. I'm hazy on the merits of 
> having a second, undocumented form of error recovery that differs from the 
> spec. It renders the report of "valid CSS information" deceptive.

I dug a bit more in the code, and found the culprit. while skipStatement 
was correctly skipping {} blocks, it was not the case for 
skipAfterExpression (responsible for errors happening when parsing right 
hand side of <prop> : <value>. Now fixed and in place at:

http://qa-dev.w3.org:8001/css-validator/

Note that it is not in sync completely with the error recovery rules 
defined by CSS21 (like on EOF)

-- 
Baroula que barouleras, au tiéu toujou t'entourneras.

         ~~Yves
Received on Monday, 17 March 2008 14:05:06 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 27 June 2012 00:14:20 GMT