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

Re: Malformed declarations incorrectly parsed?

From: Benjamin Hawkes-Lewis <bhawkeslewis@googlemail.com>
Date: Sat, 15 Mar 2008 01:21:06 +0000
Message-ID: <47DB2482.2060802@googlemail.com>
To: Yves Lafon <ylafon@w3.org>
CC: www-validator-css@w3.org

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.

--
Benjamin Hawkes-Lewis
Received on Saturday, 15 March 2008 01:21:47 GMT

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