W3C home > Mailing lists > Public > public-html@w3.org > April 2007

Re: Use the role-attribute instead of predefined class names

From: Matthew Raymond <mattraymond@earthlink.net>
Date: Sat, 07 Apr 2007 21:40:23 -0400
Message-ID: <46184807.30208@earthlink.net>
To: Dao Gottwald <dao@design-noir.de>
CC: public-html@w3.org

Dao Gottwald wrote:
> Laurens Holst wrote:
>>>    Secondly, using attributes for "subclassing" can be a descent into
>>> madness:
>>>
>>> | <div role="section article">...</div>
>>> | <role="div section article">...</>
>>>   
>> That’s taking it too far obviously. The section types have in common 
>> that they’re all sections. Div doesn’t really mean anything. A role 
>> element means even less than div. I think you can hardly call it 
>> ‘subclassing’ at that point.
> 
> It wasn't a role element, but an empty-named element (wtf?) with a role 
> attribute. Frankly, I don't get what Matthew was trying to say there.

   The point was that if you move enough semantics out of the element
and into global attributes, the elements become meaningless empty husks.
Seemed like a pretty simple concept to me, but I guess it wasn't as
clear as I thought.

>> Role just needs to be defined so that it’s very clear that it’s not an 
>> equivalent of the class attribute.
> 
> If the current definition of the class attribute isn't clear in terms of 
> that classes should be semantic, that can and should be fixed. 

   It's not clear in the specification, but it's not precluded, and can
certainly be fixed.

> Pre-defined classes can help there as good examples, btw. I also think 
> risk of really breaking existing sites is low.

   I don't like predefined classes. To me, the |class| attribute
represents and extension mechanism, and having predefined classes is
like having official extensions, which is a paradox. (OpenGL has them,
but that's only because Microsoft doesn't implement anything beyond
something like OpenGL 1.1.) If something rises to the level of needing
to be put in a specification, it should be put into the markup, not into
an extension mechanism.
Received on Sunday, 8 April 2007 01:38:39 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 9 May 2012 00:15:52 GMT