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

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 UTC