W3C home > Mailing lists > Public > www-validator-css@w3.org > July 2002

CssColor problem with mobile profile

From: David Berry <david.berry@3glab.com>
Date: Mon, 17 Jun 2002 12:04:42 -0400 (EDT)
Message-ID: <3D0E0893.2030109@3glab.com>
To: www-validator-css@w3.org




If you send this style sheet to the validator and turn on the -mobile
option in the source code as checked out of CVS running from the command line.

I sent some earlier mail to the mailing list in relation to using the
mobile profile option, which originally did not appear. I am re-sending
it as it should make the context of this more meaningful.

H1 {
   color: #0000ff;
   background-color: #00ff00;
}

Then it will return the following error,

URI : http://localhost:8088/extras/simple.css
  Line : 3 Context : H1  in property : color
	#0000ff is not a color value : #0000ff
  Line : 4 Context : H1  in property : background-color
	#00ff00 is not a background-color value : #00ff00

The error comes from org.w3c.css.properties.CssColorCSS2.java it fails
because the CssValue is an instance of an org.w3c.css.values.CssColor.
The properties classes CssColorCSS2.java and CssColorCSS1.java both
expect an org.w3c.css.values.CssColorCSS1 org.w3c.css.values.CssColorCSS2
respectively.

The parser on finding a hexcolor always creates a new org.w3c.css.values.CssColor().
The reason this works for the CSS2 only option is that the properties
configuration file specifies that for color attributes it should use an
org.w3c.css.properties.CssColor. The Mobile profile properties specifies
a org.w3c.css.properties.CssColorCSS2.

Now I can think of several options to fix the problem,

1. Easiest have the mobile profile use a org.w3c.css.properties.CssColor
2. Change the parser to allow hexolor to generate the different color/class
    types.
3. Fix the CSS1, CSS2, properties classes to allow for instances of CssColor
    values.

I've taken option 1 for the moment, but I think there is a deeper issue
here that I feel needs input from the good people behind the validator.

Thanks,
Dave

david.berry@3glab.com
Received on Thursday, 11 July 2002 18:13:24 GMT

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