W3C home > Mailing lists > Public > www-validator-css@w3.org > October 2011

Re: Rationale for the warning "Same colors for color and background-color in two contexts"?

From: Jukka K. Korpela <jkorpela@cs.tut.fi>
Date: Tue, 04 Oct 2011 23:29:02 +0300
Message-ID: <4E8B6C8E.4080106@cs.tut.fi>
To: "www-validator-css@w3.org" <www-validator-css@w3.org>
4.10.2011 23:01, Philip TAYLOR (Webmaster, Ret'd) wrote:

>> a { color: black; }
>> b { background: black; }
>
> Well. Isn't it simply the case that we are discussing
> CSS, rather than CSS embedded in HTML, and therefore
> the CSS validator can have no knowledge as to whether
> an <a> element will be embedded in a <b> element, and
> therefore seeks to warn the user that such a usage
> would be ill-advised ?

The CSS validator surely needs to deal with CSS in general, without 
information about the meanings of elements or their allowed or actual 
nesting. But if the warning is based on speculation on possible nesting 
and the possible effects of background transparency, I'm afraid it goes 
far too far. Are there any real problems that have been detected thanks 
to these warnings? I'm pretty sure there are many more problems 
(confusion among authors) _caused_ by the warnings.

In any case, if these warnings are issued, they should be explained in 
the CSS Validator FAQ or in other documentation.

> http://web-consultants.org.uk/sites/tests/colour-test.html
>
> However, I should report that that page, when validated,
> does /not/ throw up the warning that you report, at least
> by default :
>
> http://jigsaw.w3.org/css-validator/validator?uri=http%3A%2F%2Fweb-consultants.org.uk%2Fsites%2Ftests%2Fcolour-test.html

Oddly enough, if I go to http://jigsaw.w3.org/css-validator/ and either 
enter your URL in the "By URI" dialog or copypaste its content into the 
"By direct input" dialog, without changing the defaults, I do get the 
warning. And I checked that in "More Options", Warnings are set to 
"Normal report".

-- 
Yucca, http://www.cs.tut.fi/~jkorpela/
Received on Tuesday, 4 October 2011 20:29:42 GMT

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