Thursday, July 12, 2012

The Role Attribute Module - years in the making

Way back in the olden days when we were developing XHTML Modularization and then XHTML2, the group recognized that there were lots of pieces of XHTML2 that were generally useful and that it should be possible to publish them separately.  The concept was that since these were modules they would be assembled by host language authors as needed, and then at some point pulled together into XHTML2.  Obviously XHTML2 never came to be, but a lot of the pieces did get worked on and pulled into other work (e.g., RDFa, Role, all sorts of stuff in HTML5 although no one will ever admit that).


Today I wanted to talk about the Role Attribute.  This piece of XHTML2 is a deceptively simple attribute.  It's purpose is to help content authors label an element with it's role or roles within a document. Why do elements have roles?  Well  - that's complicated.  First, some (more) history...

Sometimes W3C working groups have face to face meetings.  At one such meeting of the XHTML working group (at the AOL headquarters in Virginia I think) a group member was wearing their liaison hat between the XHTML working group and the group responsible for accessibility.  They REALLY wanted to be able to have sections of the document labeled so that assistive technologies (ATs) could more easily help people with various disabilities use the web more efficiently.  In particular, things like navigation areas, headers, footers, content, sidebars...  and of course controls.  The accessibility liaison thought it was important that we define a base collection of roles, but also that it be possible to dynamically extend that collection of roles easily. The group thought this was a fine idea, and added the role attribute to XHTML2.  The base collection has been modified over time - you can see its current form in the Vocabulary Document.

Fast forward to today.  The W3C has today published the Role Attribute as a Candidate Recommendation.  A lot has happened in the W3C community since we started work on this simple attribute, but the basic form of the Role Attribute and its capabilities has not changed much at all.  There is an attribute named 'role'.  It takes a list of zero or more values.  These values are either pre-defined TERMs (the things in that vocabulary document), a URI, or a CURIE (a CURIE is a compact URI - a concept defined by RDFa Core).  Assistive Technologies can use the values of role, in conjunction with other information from the ARIA Attributes, to more-or-less automatically make pages more accessible. RDFa processors can use the information in role attributes to automatically learn more about the semantics of a page.


This specification is stable now.  The attribute works in all modern user agents now.  It's values are interpreted by many assistive technologies already.  It is already supported by some RDFa processors, with more on the way.  Even though the W3C says people shouldn't rely upon stuff in Candidate Recommendations because they might not be fully cooked yet, I say go for it.  Role works and it can't hurt.  RDFa works well, and is processed by popular search engines like Google and Bing.  Telling the browser (and any Assistive Technologies that might be looking at the browser) what the role of the various parts of your web page isn't just polite, it might help someone use your site more effectively!

5 comments:

Steven Pemberton said...

I see Facebook has started using it! Congratulations (to you and me as well, since we are the ones who started it all).

Radjapov said...

" If youve played Big 2, Thirteen, Deuces, or Presidents, youll love this fresh new take on the game. downlodable warez Turn on "Hide Hop-Ons" to hide these replies from view.

HD Songs said...

I have read a few of the articles on your website now, and I really like your style of blogging. I added it to my favorites blog site list and will be checking back soon. Please check out my site as well and let me know what you think. font face generator

Feral H said...

This fews really great for me and I hope It only gets better, thanks a lot. www.expertdaconquista.com

Imperial Voyages Tour Operators said...

Travel And Tour Operators in Delhi India Book Affordable Travel Agency In India Travel And Tour Packages we Provide All India Travel And Tour Packages.Toru Operators In Delhi