Re: Warnings for non-applicable properties

Paul Arzul wrote:

> we could use the "Default style sheet for HTML 4":
> http://www.w3.org/TR/CSS21/sample.html

That style sheet is purported to be both descriptive and prescriptive (read 
the prelude carefully, and you'll see how messed-up it is). In reality, it 
is neither. No browser implements it (though most parts thereof are more or 
less consistent with real practices). Nobody who reads it with his brain 
turned on thinks it _should_ be implemented - it has obscurities and poor 
practices.

> some research against common browsers's user agent stylesheets should
> be done to check for any serious discrepancies.

I don't think so. What good would it do? It is useful for using CSS (I did 
some serious work on this for my book on CSS), but that's not a "validation" 
issue or even a "lint" issue. We should expect and accept that browsers 
differ.

> as always the cascade applies,

As always, most people either misunderstand or forget the cascade. The 
cascade is the most complex and most controversial part of CSS, but it's 
there.

> but it is still useful to know that a single css file is generating
> warnings

Is it? I mean when the warnings are based on the assumption that the style 
sheet is used in isolation. Useful analysis could be performed by a 
_browser_, which can determine all the style sheets it is applying. So such 
kind of checking is best performed by a real browser, not a checker program. 
It's something that should be implemented as an addition or a plug-in to 
Firefox, for example, rather than a standalone utility by W3C for example.

-> is it unfortunate that the html4 stylesheet is only informative?

No, but it is unfortunate that it does not say this clearly and it does not 
say what it tries to inform. It claims to be informative, and next it tells 
browser vendors to implement it. Sigh.

> perhaps html5 could then consider giving us a normative default user
> agent stylesheet - or at least a normative version with only display
> properties.

Various HTML specs have made notes about "typical rendering" and even 
suggested rendering, usually in an ill-advised manner. Such statements have 
always been taken a stronger than intended. Moreover, the suggested 
rendering is usually lousy. Who invented the idea of having equal spacing 
above and under a heading, empty lines between paragraphs, large indents for 
lists, and nonzero cellspacing? People who design markup languages need not 
be experts in typography, and they usually aren't even good at it. People 
who implement markup languages should include experts in typography, but we 
all know how it goes. Anyway, no specification should fix some sloppily 
written default rendering rules as "correct", thereby declaring good 
typography as anathema.

P.S. One of the most common problems with property settings that get ignored 
(by conforming browsers) is that some properties, such as width, are set for 
non-replaced inline elements even though they don't apply to them. Catching 
these could be useful, but how would you do that? It's not even clear what 
elements are non-replaced inline elements by default. Moreover, any <span> 
or <a> can become a block element just with the magic of display: block, and 
this is fairly common. And to know whether such a magic applies to a given 
element, you really need to process and _interpret_ all the style sheets 
that apply.

-- 
Yucca, http://www.cs.tut.fi/~jkorpela/ 

Received on Monday, 10 November 2008 18:01:53 UTC