Skip to content
 

Home

WAI-ARIA finally added to HTML5

Written by Joshue O Connor Friday, 28 August 2009

WAI-ARIA is an incredibly powerful technology that allows developers to easily describe the purpose, state and other functionality of visually rich user interfaces - in a way that can be understood by Assistive Technology. WAI-ARIA has finally been integrated into the current working draft of the HTML 5 specification.

Please note the terms WAI-ARIA and ARIA refer to the same thing. However, it is more correct to use WAI-ARIA to acknowledge its origins in WAI.

Even before it was integrated into HTML 5, WAI-ARIA had already gained partial support in many of the major browsers, most notably IE, Firefox and Opera. It also gained support in the more commonly used screen readers such as JAWS, Window Eyes and the excellent (and free), NVDA.

"For a really interesting overview of current screen reader support read Marco Zehe of Mozilla’s excellent ‘WAI-ARIA Windows screen reader shootout’ article".

Born out of DHTML

WAI-ARIA was originally a bridging technology that came out of the WAI DHTML Roadmap. This initiative arose out of the very practical need for addressing the inaccessibility of much dynamic web content for people with disabilities. This came at a time where more Web 2.0 developers were using Javascript more and more, as well as coming up against the inherent limitations in HTML 4 when building dynamic applications with rich user interfaces. It was often very difficult to make these applications accessible. Some of the main issues were:

  • Accessibility is dependent on abstracting semantics from both content and presentation information. Extracting these semantics from HTML content was not reliable.
  • HTML allowed content to be re-purposed for presentation formatting without providing a way to convey this information. A common example of this is the use of tables for formatting content as opposed to style sheets.
  • HTML, when combined with script and CSS, may be re-purposed to create dynamic custom components without the ability for the author to convey this information to the native accessibility architectures designed to support dynamic GUI content.
  • HTML lacked the ability to attach meaningful meta data about document structure.

So what to do?

The DHTML Roadmap aimed to look at the semantic gap that obviously existed and thereby develop a flexible toolkit that developers could freely use now to provide the semantic hooks needed to develop accessible interfaces.

But hang on, I hear you say, isn’t the markup language supposed to provide these semantics in the first place? Yes it is, but HTML was primarily designed as a document markup language, not the scaffolding for rich user interfaces and dynamic content.

While this roadmap was being put together, HTML 5 was still very much in early stages. HTML 5 was being developed from scratch and there were naturally all the delays inherent in specification writing. There was a solution needed immediately that could work with existing markup languages. So WAI-ARIA was born.

What does WAI-ARIA code look like?

Here are some examples of what WAI-ARIA code looks like and what you can do with it:

To set landmarks roles on a semantically neutral <div>

<div role="log" title="chat log">
<div role="region" title="Game Statistics">  

For application landmarks with static prose

If you have a regional landmark of type application and static descriptive text is available, then on the application landmark, include an aria-describedby reference to associate the application and the static text as shown here:

<div role="application" 
aria-labelledby="calendar"
aria-describedby="info">

<h1 id="calendar">Calendar<h1>
<p id="info">
This calendar shows the game 
schedule for the Boston Red Sox. </p> <div role="grid"> .... </div>

Static Table of Contents Directory

The ARIA role, directory, allows authors to mark static table of content sections of a document. Prior to ARIA, the user would need to guess if an area of a document actually pertained to the table of contents. Authors should mark these sections within a document with a role of directory.

<div role="directory">

<ul>
<li>Global Warming Causes
<ul>
<li>CO2 Buildup</li>
<li>Auto emissions</li>

<li>Factory emissions</li>
<li>Destruction of rainforests</li>
</ul>

</li>

<li>Tailoring CO2 buildup
<ul>
<li>Elimination of the incandescent
light bulb</li> <li>Hydrogen fuel cells</li> <li>Solar energy</li> <li>Wind power</li> </ul> </li> </ul> </div>

There is a lot of other cool stuff that WAI-ARIA can do such as allowing the developer to set the required fields on a form (no more useless asterisk) in a much more reliable way, or alerting the user when maximum field length has been reached on input controls, or simple focus changes after user input to enhance usability. And that is before we touch on the incredibly useful aria-describedby and aria-labelledby or how WAI-ARIA is improving the accessibility of your favourite Open Source Content Management Systems (CMS).

WAI-ARIA is a nice polite technology in that it will not cause errors in user agents that do not support it, so no crashes or freezes, or people just not being able to access some, or all, of your application. WAI-ARIA is a host agnostic language, meaning it can be plugged into many languages such as HTML, XHTML, SVG - with the same syntax - and is recognized by the user agents that support it and just ignored by those that don’t.

All excellent. And also only the tip of the iceberg. However, is it really that simple?

Strong vs. Weak vs. Implicit Semantics

When developers start adding WAI-ARIA role, states and properties mark up to built smart widgets and controls, this would generally take one of two forms. Adding this extra markup to a semantically neutral <div> or to existing markup like anchors element, or form controls in HTML markup.

So, the <div> elements have no semantic properties at all so this is why we can easily add the ARIA markup without to much ado, I hear you cry? Well, yes. But don’t many HTML elements have their own inherent semantics? Well, yes. So could there be a clash between what the ARIA role is trying to describe and the inherent semantics of the host elements? Well, yes.

So how does HTML 5 propose to deal with this issue? What would user agents do in these scenarios and are their other potential problems these kind of conflicts could cause?

Some of the Issues, as outlined by WAI’s Michael Cooper are:

  • Existing host language features should not, in theory, be reclassified with ARIA roles.
  • Defining the processing model for such situations:
    <input type="checkbox" role="radio" />
    was presented as a frequent example, or because the host language element is semantically similar to an ARIA role and should be used for that purpose without reclassification.
  • Host languages evolve and provide features that previously authors could only achieve with repurposed elements.
  • Legacy content may include ARIA repurposing of elements that would not be required in newer content using the updated host language.

So the idea of ‘implicit ARIA semantics’ was born to deal with some of the more foreseeable situations where a conflict is likely to occur.

Overriding HTML semantics with ARIA

In the new section of the HTML 5 specification that deals with WAI-ARIA (Annotations for Assistive Technology Products), the spec states that some HTML elements have semantics that can be overridden, these include the new HTML 5 elements such as <article>, <aside>, <section> and existing elements that will be familiar from HTML 4 such as <li>, <ol> and <ul>.

Don’t worry if you are not familiar with these new HTML 5 elements, they pretty much do what they say on the tin! The same applies to the ARIA role markup. You are just describing literally to Assistive Technology what the purpose or role or state of the current element (or indeed the entire widget is).

The <article>, <aside>, <section> elements have the following applied semantics ‘article role’, ‘note role’ and ‘region role’ and the <li> element (whose parent is an <ol> or a <ul> element has the ‘listitem role’ and where that is not the case the <ul> and <ol> elements both have the implied semantic of a ‘list role’.

So what are the inherent semantic restrictions? The specification defines that where ARIA is applied to any of the above HTML elements they must have the following roles:

  • An <article> element Role must be either article, document, application, or main
  • An <aside> element Role must be either note, complementary, or search
  • A <section> element Role must be either region, document, application, contentinfo, main, search, alert, dialog, alertdialog, status, or log

I hope it may now be a bit clearer to you why there is potential for conflict with these elements. If not, there is an interesting post by Operas Anne Van Kesteren that discusses role duplication, and Jeremy Keith has some interesting related links from his post 'Ariability'. There are other knock on effects of changing an elements role and that is with the host elements corresponding states and properties that are also potentially effected by the role change - but that’s a discussion for another day.

Applying these constraints to how host elements should behave when ARIA roles are applied gives a clearer content model to determine how the user agents should perform when the markup just goes wrong, or when developers come with new creative ways of marking up their content (as they are want to do). So this is a very exiting development to see WAI-ARIA finally make it in the HTML 5 specification and while there are details to be ironed out (and some very interesting issues that I hope I have given you a glimpse of) it is fascinating to track the semantic struggle that will enable the power of HTML 5 and flexibility of WAI-ARIA to co-exist and compliment each other in a positive dynamic way.

Add your comment

Your name:
Your email:
Your website:
Subject:
Comment (you may use HTML tags here):

Comments (10)

Current PFWG thinking on ARIA integration in host languages

1 Tuesday, 01 September 2009
Joshue O Connor
Public HTML 5 WG response from Protocols and Formats

WAI-ARIA

2 Wednesday, 19 May 2010
Mike Smith
You raised a good question that got us started looking at a few
potential inconsistencies in how roles and ARIA states and properties
interact with host language semantics. We think we have a direction for
addressing this but don't have anything written up yet. I don't feel
able to summarize it right now but hope to have more information in a
couple weeks.

WAI-ARIA finally added to HTML5

3 Thursday, 10 June 2010
Darian from London
Excellent information. I did not know lot of these things about HTML. Thank you very much and keep up the good work!

Much appreciated

4 Friday, 23 July 2010
vanity tables
I'll be subscribing to your feed and I hope you post again soon. Your HTML posts really rock

wai-aria

5 Saturday, 24 July 2010
David J
well worth the read. thank you very much for taking the time to share with those who are starting on the subject. greetings

Thats so cool...

6 Monday, 26 July 2010
error fix
I'll be subscribing to your feed and I hope you post again soon. Your HTML posts really rock

Thank you

7 Monday, 26 July 2010
justin drew bieber
Before I say the usability of this technology, I would like to thank you guys for stressing out the fact that WAI-ARIA and ARIA are the same thing. Many people still come and ask me whether they are two different things. I just reply to them asking whether Mercedes and Benz are different! The technology is simply superb and I do not think there is no tool that matches its simplicity which I guess is the most important feature of WAI-ARIA.

cool

8 Tuesday, 27 July 2010
autolening
I am posting here just to let you know that you are doing a good job by keeping us posted about this.
Please keep on posting such quality articles as this is a rare thing to find these days. I am always searching online for articles that can help me. Looking forward to another great blog. Good luck to the author! all the best!

cool

9 Friday, 30 July 2010
Pool Remodel
The blog is in reality the great on this worthy subject. I match in together with your conclusions and looking forward to your coming updates.
Just saying thanks will not just be enough, for the fantastic clarity inside your writing. I put a link to your blog at my site, hope you don't mind?

Lakhimpur Kheri

10 Friday, 30 July 2010
Lakhimpur Kheri
Travelling lakhimpur provides information about travel destinations in lakhimpur kheri, available hotel, temple’s and road map.
yvComment v.1.22.0
  • Home

What We Do

  • Web Accessibility
  • Digital TV Accessibility

Consultancy

  • CFIT Services
  • Web Accessibility Auditing
  • User Testing
  • Web Accessibility Training

About Us

  • About CFIT
  • Clients and Partners
  • Case Studies
  • Contact Us
  • Site Map

News and commentary

Read all articles
Subscribe to RSS feed

What we're doing now

  • Defining judging criteria for the 2010 eircom Spider Awards
  • Developing 'Curriculum for training professionals in Universal Design' (CEN UD-PROF)

  • First review of VICON project complete

  • Working on the Digital Agenda for Europe

  • Auditing Waterford County Council

See all we've done.

CFIT is also involved in...

The WAI Protocols and Formats Working Group, the Irish Internet Association User Experience Working Group, European Commission Mandate M376, the ComReg forum on Communications Services for People with Disabilities, the W3C HTML 5 Working Group, the TV Access Coalition for accessible digital television and more ...

See all our involvements.


NCBI Centre for Inclusive Technology (CFIT)

Digital Accessibility

Promotion : Education : Assistance

CFIT Tweets

NCBI CFIT
doing accessibility and standards judging for eircom spiders awards ... hope it's easier than last year http://bit.ly/diiXIK
NCBI CFIT
Some great ideas for student projects in accessible ICT design http://bit.ly/bycozC
NCBI CFIT
Fluid Design Handbook: How to include user-centered design in your projects. http://fluidproject.org/products/fluid-design-handbook/ #ud
NCBI CFIT
@w3c: We welcome all to take the survey: Making W3C the place for new Web standards http://www.w3.org/2002/09/wbs/1/newstd2/ #openw3c
NCBI CFIT
CFIT attends first review of VICON Project at the European Commission offices http://tinyurl.com/2wagln4 #a11y