- From: Bjoern Hoehrmann <derhoermi@gmx.net>
- Date: Tue, 01 Jun 2004 17:32:29 +0200
- To: Dave Shea <dave@mezzoblue.com>
- Cc: www-validator-css@w3.org
* Dave Shea wrote:
>A few observances I've discussed with various people over the past few
>days. It seems the CSS validator is acting oddly under certain
>circumstances.
>
>Consider the following snippet:
>
>p { font: bold italic large Palatino, serif }
>
>If you validate through textarea, it passes, but the results listing
>reverses the order of 'bold' and 'italic'. I could potentially see this
>as a result of parsing, but it's a bit disconcerting.
Yes, you get a normalized version of the input. If you have multiple
physical style sheets, the validator combines them to a single style
sheet, if you have a 0 length like 0px it will remove the unit, if a
property can have multiple values in any order it will pretty print
the values in a "normal" order, etc. It's probably not ideal, but it
does not seem to be critical...
>Now consider this example:
>
>p { font: normal italic 12pt georgia, serif; }
>
>Valid, but it results in an error.
Yes. I have filed a bug report for it, see
http://www.w3.org/Bugs/Public/show_bug.cgi?id=777
This would in CSS 2.1 be equivalent to
font-variant: normal;
font-weight: normal;
font-style: italic;
font-size: 12pt;
line-height: normal;
font-family: georgia, serif;
What the Validator currently does is to check whether the first value is
a legal <'font-style'> and if it is, it assigns the value to its
internal representation for the font-style part of the font property and
then continues to look for legal values. Since it already determined the
value for font-style it will not check it again, but rather for
<'font-variant'> and <'font-weight'>. Since that fails it expects the
next value to be a <'font-size'> as it would be required by the grammar.
That fails as "italic" is not a legal <'font-weight'> and hence the
error message. See the code from line 131 to 186 in
http://dev.w3.org/cvsweb/2002/css-validator/org/w3c/css/properties/CssFont.java?annotate=1.2
>Next and last example, taken from
>http://css.researchkitchen.de/validation.html:
>
>div { border: 1px solid c85; }
>
>Passes as valid, though the color value is clearly invalid.
See my earlier bug report
http://www.w3.org/Bugs/Public/show_bug.cgi?id=287
>More thoughts and an interesting observation:
>http://www.minzweb.de/en/pages/sitetopics/archive_permalink.asp?id=42
This is, in part, covered by
http://www.w3.org/Bugs/Public/show_bug.cgi?id=737
and I am glad to tell you that this is fixed (though the online version
has not been updated yet). The style sheet will now be considered valid
regardless of whether usermedium=all or no usermedium is specified. Ok,
this is not yet ideal, but I feel we are getting closer :-) I've filed
another bug report for <http://css.researchkitchen.de/validation.html>,
http://www.w3.org/Bugs/Public/show_bug.cgi?id=778
This might turn out to be some kind of setup problem...
Thanks for your report!
Received on Tuesday, 1 June 2004 11:33:02 UTC