This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 2412 - Color attributes not validated?
Summary: Color attributes not validated?
Alias: None
Product: Validator
Classification: Unclassified
Component: Parser (show other bugs)
Version: 0.7.0
Hardware: All All
: P3 normal
Target Milestone: ---
Assignee: Terje Bless
QA Contact: qa-dev tracking
Depends on:
Reported: 2005-10-22 17:22 UTC by Matt LaPlante
Modified: 2005-10-22 17:27 UTC (History)
0 users

See Also:


Description Matt LaPlante 2005-10-22 17:22:28 UTC
This issue was brought to my attention earlier today:  the validator does not
seem to do any integrity checking on attributes that specify color.  As a very
simple example, consider the tag:
<body bgcolor="#CC0000">

This is perfectly normal and validates fine.  Now consider:

<body bgcolor="#CC00">

This is apparently invalid.  In fact, Mozilla browsers will not accept this tag
and will render white.  This was brought to my attention when a beginning
webmaster asked my why his backgrounds only worked in IE.  My first reaction was
to tell him to use the validator to check his code.  To my dismay I realized
that the validator passed the above short tag with flying colors, no pun intended.

I'm not sure how the actual HTML specification regards this issue, or how far in
depth the validation should go, but I think merely adding a regex to check for
the # followed by 6 chars would be a big help.
Comment 1 Bj 2005-10-22 17:27:42 UTC
Yes, the Validator will only check for constraints spelled out in the DTD of 
the relevant format. We are working on solutions to this problem. In the 
meantime you might want to try tools like HTML Tidy or 
which should be better at complaining about such problems.