Re: Cleaning House

On Fri, 4 May 2007, Henri Sivonen wrote:

> The HTML5 draft 
> contains a preliminary proposal for registering the semantics of class names 
> to foster better multi-party understanding.

That's typical of the eclectic nature of the draft and conflicts with the 
idea of "compatibility" in the sense of displaying existing web content 
properly.

If you assign special meanings to class names, you change the meaning of 
existing pages, and if these meanings have any effect on rendering, you 
are also messing up with authors' intentions on presentation.

Surely it sounds nice to assign a particular meaning to elements that have 
class="foo", for some values of foo. You would effectively extend the 
language via class names as if you had added elements or attributes. 
However, then perfectly correct existing HTML documents that happen to 
have class="foo" somewhere would be mistreated in unpredictable ways.

At least the predefined class names should be _invalid_ according to 
current HTML specifications and not in actual use by authors, so that 
there would be no possible clash. This would create some other problems, 
such as the question how such class names could be used in CSS selectors 
so that existing browsers understand them.

But class names are really an illogical and clumsy method when you 
actually want a new element. Allowing <example>...</example> rather than 
<p class="example">...</p> would at least avoid the problem that an author 
who now uses class="example" gets the element processed in a way he didn't 
mean it to be handled. If someone has used <example>, he has already taken 
the risk that it might be interpreted in conflicting ways.

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

Received on Friday, 4 May 2007 17:29:34 UTC