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: Wed, 19 Mar 2008 10:31:11 +0000
Message-ID: <47E0EB6F.9020600@googlemail.com>
To: Yves Lafon <ylafon@w3.org>
CC: www-validator-css@w3.org

Yves Lafon wrote:
> On Wed, 19 Mar 2008, Benjamin Hawkes-Lewis wrote:
> 
>> Sorry, but I think you've missed the point of the test case:
>>
>> p { color:red; color:; color:green }
>>
>> The problem is not that the validator reports a redefinition of color. 
>> The problem is that if you apply the rule:
>>
>> "Lexical errors are handled with a skip to matching brace"
>>
>> Then the validator should skip to the matching brace after "color:;", 
>> since that is a "lexical error". It should not report any declarations 
>> after "color:;" at all, whether they are redefinitions or not.
> 
> In fact, the CSS21 text says that a UA must read until the end of a 
> declaration, in that case a ';' or a '}' and in doing that, ignore 
> matching pairs, like  '{..}'

I'm now very confused. :(

Yes, I know compliant implementations should read color: green; from 
that input.

But you've already said the validator isn't trying to comply with CSS 
2.1 error handling rules, so I'm not clear why you're citing them on 
this point.

I thought the validator team was ignoring them in favour of its own 
error-handling rule:

"Lexical errors are handled with a skip to matching brace"

Now you seem to be saying that the validator will sometimes apply CSS 
2.1 error-handling rules and sometimes not.

Can you please clarify, in terms of the spec, what sort of errors 
trigger error recovery complying with CSS 2.1 and what sort of errors 
trigger the incompliant "skip to matching brace" rule?

Given the following input from my first email:

h1 {color: red;}
p {font-weight: bold; width: 100em !ie; color: green;}
em {color: yellow;}

The development validator reports:

2	 p	 Value Error : width Lexical error at line 2, column 38. 
Encountered: "e" (101), after : "!i" e;
3		 Value Error : width Parse Error : green;} em

If the validator were following CSS 2.1 error recovery, it would report 
the following "valid" CSS information:

h1 {
color: red;
}
p {
font-weight : bold;
color : green;
}
em {
color: yellow;
}

If the validator were following the "skip to matching brace rule", it 
would report:


h1 {
color: red;
}
p {
font-weight : bold;
}
em {
color: yellow;
}

I cannot follow what rules it's applying when it instead reports:

h1 {
color : red;
}


--
Benjamin Hawkes-Lewis
Received on Wednesday, 19 March 2008 10:32:03 GMT

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