Re: Real problem caused by CSS validators willingness to tacitly accept HTML

Thanks for your comments, Jukka : in reverse order
(since the order is important)

>>> This behaviour has
>>> now been changed to simplify urgent work here; it
>>> may be re-instated in due course,
>> 
>> Sorry, I don't follow.

We changed the behaviour of IIS to serve its default 404
page instead of our customised one /after/ reporting the
problem because debugging real problems here was being
confused by the behaviour of the validator.


>>> 2) The CSS Validator says that validation was successful, and
>>> displays the CSS.
>> 
>> To me, it says
>> 
>> Target: http://www.rhul.ac.uk/resources/Stylesheets/CSS/TP-Common.css
>> I/O Error: http://www.rhul.ac.uk/resources/Stylesheets/CSS/TP-Common.css: 
>> Not Found
>> which is not optimal (I'd prefer seeing a clear indication of the "Not 
>> Found" response, with the HTTP error code) but not incorrect either.

That is because we changed the IIS configuration; I have now
restored the /status ante bellum/ so that the problem can
easily be demonstrated and replicated.  If you are willing,
please repeat your test for this non-existent page :

	http://jigsaw.w3.org/css-validator/validator?uri=http://www.rhul.ac.uk/resources/Stylesheets/CSS/TP-Common.css

and compare the results with those for the real page

	http://jigsaw.w3.org/css-validator/validator?uri=http://www.rhul.ac.uk/resources/Style-sheets/CSS/TP-Common.css


>> 1) The CSS validator is asked to validate a non-existent CSS page
>>
>> http://jigsaw.w3.org/css-validator/validator?uri=http://www.rhul.ac.uk/resources/Stylesheets/CSS/TP-Common.css
> 
> Technically, it is asked to check a resource that does not exist. A 
> nonexistent resource has no type, so we can't call it a non-existent CSS 
> page.

I think we "can", but whether we "should" is another matter :-)

> 
>> The IIS is configured to serve a custom 404 (HTML) web
>> page on encountering a 404,
> 
> That's fine, though the server is also configured to include nonsense in its 
> response:
> 
> "The Web site you are trying to access has an IP address that is configured 
> not to accept requests that specify a port number."

This is probably from the IIS default page that was configured
to help with our internal debugging after reporting the problem
with the validator; I don't believe you will now see that response.

>> and this page page links
>> to a subtly different version of the CSS file intended
>> to be specified at (1) above.
> 
> It seems that you have somehow encountered a situation where the W3C CSS 
> Validator treats the error message page (accompanying the 404 response) as a 
> response to the request. That would be a mistake, a protocol error, but I 
> cannot construct the situation. _If_ it happens, the rest is natural, since 
> the W3C CSS Validator is _supposed_ to handle HTML documents as well.

Yes, that is exactly it.  But as the validator was asked to validate
"<something>.css", it should ?surely? complain (or warn the user
loudly) if it is instead sent <something-else>.html (IMHO).

> 
>> Request : could the CSS validator /please/ report (very
>> loudly !) if the returned resource is declared at
>> HTTP level to be anything other than "text/css",
> 
> The W3C CSS Validator is capable of handling HTML documents as well, and 
> this is a _very_ useful thing and should not be disturbed. If there is or 
> was a problem, it was in the handling of HTTP error responses.

But if it is asked to validate a resource ending in ".CSS", and
receives a resource with MIME type "text/html", surely it should
report a configuration error or worse ?  (The configuration of
the server, that is, not of the validator).
> 
>> and could it also please report if the served file
>> appears not to be CSS but (say) HTML with CSS embedded
>> or linked ?
> 
> I don't think there's a reason to make a noise about that, since it's 
> intended behavior and clearly indicated in the user interface for submitting 
> a URL for checking.
> 
> But admittedly the wording is slightly misleading when it says
> 
> "This document validates as CSS!"
> 
> for a document that is not a CSS stylesheet. An adequate statement would be 
> something like
> 
> "The CSS style sheets included in the submitted document or referred to by 
> it are syntactically correct."

But what is echoed by the validator is /just/ the CSS, leading the
user to believe that that is what it received ...

** Phil.

Received on Wednesday, 31 October 2007 17:04:40 UTC