Use the role-attribute instead of predefined class names

Hello, the following issue was already raised a few times, however, 
there was no "big discussion" about it yet.

In my opinion the XHTML 2 role-attribute is far superior to the Web 
Applications 1.0 predefined class names because the latter got several 
disadvantages:

I don't think they are what most here call backward compatible. 
Predefined class names are limited to few elements. I'm using class 
names like "copyright" already and, like many other authors, I'm not 
only using it on p- and span-elements. It'd be confusing if some 
elements with class name X got a different meanign than special elements 
with class name X. Also It's unclear how elements with class names that 
aren't allowed on that element should be handled. Are they invalid or 
ignored. I think that part of the WA-Spec is very imature. (Adding new 
class names could be very chaotic very soon).
The same problem is applying to class names that aren't yet predefined, 
but may become so in the future.

Redundancy is alo a point that comes to my mind. I personally would use 
a div- or section-element with the class name "copyright" as a parent 
for copyright-specific paragraphs and lists. I think that's better that 
a series of p-elements wearing the class name "copyright".

Frankly speaking, I think predefined class names are confusing and make 
an authors life harder. You've got to now, class name X is predefined 
and class name Y can only be used on element Z. Not very intuitive IMHO.

My idea would be to merge the role-attribut with the predefined class 
names (e.g. role="copyright"). This is reflecting my way of using that 
class name (grouping elements in a div-element with the 
copyright-class). However, together with the role-attribute, an element 
would be enhanced semantically, which can be used by search enginges and 
similar user agents.
Besides, I think this approach is more useful when working with CSS.

~ ds

Received on Thursday, 5 April 2007 19:26:18 UTC