W3C home > Mailing lists > Public > public-qa-dev@w3.org > July 2008

Leftover code in the CSS Validator ?

From: Damien B <night.kame@gmail.com>
Date: Thu, 24 Jul 2008 16:24:14 +0200
Message-ID: <4888908E.7020904@gmail.com>
To: public-qa-dev@w3.org


while doing some experiments to write a GUI for the CSS Validator, I've 
found a strange behaviour.
When validating http://www.w3.org, I've got some errors on:

voice-family: inherit;

Which seems perfectly acceptable.
The relevant code in ACssVoiceFamily is here:
if (val.equals(inherit)) {
     if(value.getCount() > 1) {
	throw new InvalidParamException("unrecognize", ac);
     inheritValue = true;

Which is fine and executed correctly, except that "val" is obtained by
CssValue val = value.getValue();
and getValue() does not consume the token.

Back in CssParser:
CssProperty p = handleDeclaration(string_property.toLowerCase(),
                                                   values, important);
// Did the property recognize all values in the expression ?
if (!values.end() && ac.getMedium() == null) {
      addError(new InvalidParamException("unrecognize", "", ac),
} else {
    // ok, return the new property
    {if (true) return p;}  <--- smells like temporary code :-D

So, in that case, "!values.end()" is true, and in my test, 
ac.getMedium() is null, thus the reported errors.

But, with the CSS Validator online service, there is no way to set 
Medium to null, thus the "errors" go unnoticed.
So basically, in the online validator, the execution path is this one:
if (false) {
} else {
    {if (true) return p;}

So... I don't know how to conclude. What happens next? :-)

Damien B
Received on Thursday, 24 July 2008 14:27:06 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:54:53 UTC