W3C

WAI-ARIA Best Practices

W3C Working Draft 9 May 2008

This version:
http://www.w3.org/WAI/PF/aria-practices/
Latest public version:
http://www.w3.org/TR/wai-aria-practices/
Editors:
Lisa Pappas, SAS
Michael Cooper, W3C
Richard Schwerdtfeger, IBM

Abstract

This document specifies Best Practices for delivering accessible rich internet applications using WAI-ARIA [ARIA]. The principle objective is to produce a usable, accessible experience over the Web. It provides recommended approaches to create accessible Web content using WAI-ARIA roles, states, and properties to make widgets, navigation, and behaviors accessible. The document also describes considerations that might not be evident to most implementers from the WAI-ARIA specification alone. This document is directed primarily to Web application developers, but the guidance is also useful to user agent and assistive technology developers. This document is part of the WAI-ARIA suite described in the ARIA Overview.

Status of This Document

This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at http://www.w3.org/TR/.

This is an internal Working Draft of the Protocols and Formats Working Group. It is not stable and may change at any time. Implementors should not use this for anything other than experimental implementations. This document is available to W3C Members and should not be distributed to anyone who does not have W3C Member access.

Publication as a Working Draft does not imply endorsement by the W3C Membership. This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.

This document was produced by a group operating under the 5 February 2004 W3C Patent Policy. The group does not expect this document to become a W3C Recommendation. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.

The disclosure obligations of the Participants of this group are described in the charter.

Table of Contents

  1. 1 Introduction
  2. 2 General Steps for Building an Accessible Widget with ARIA
  3. 3 Keyboard and Structural Navigation
    1. 3.1 Providing Keyboard Navigation for Widgets
      1. 3.1.1 ARIA Keyboard Bindings and Behaviors
      2. 3.1.2 Keyboard Navigation between Widgets
      3. 3.1.3 Keyboard Navigation within Widgets
      4. 3.1.4 Example Keyboard Operation: Radio Group/Radio
      5. 3.1.5 Other Widget Best Practices
      6. 3.1.6 Validation Issues
    2. 3.2 Providing Keyboard Focus
      1. 3.2.1 Tabindex
      2. 3.2.2 Using activedescendant vs. tabindex for to manage focus of widget children
      3. 3.2.3 Author-Defined Keyboard Short-Cuts or Mnemonics
    3. 3.3 Supporting Tooltips with the Keyboard
    4. 3.4 Providing Navigable Structure within Web Pages
      1. 3.4.1 Steps for defining a logical navigational structure
      2. 3.4.2 Structural roles used to facilitate assistive technology navigation
      3. 3.4.3 Implicit Nesting and Headings
      4. 3.4.4 Grouping, Regions, and Directories
      5. 3.4.5 Remaining structural roles
  4. 4 Relationships
    1. 4.1 Labeling and Describing
      1. 4.1.1 Labelled By
      2. 4.1.2 Described By
    2. 4.2 Owning and Controlling
      1. 4.2.1 The owns relationship.
      2. 4.2.2  Using owns with reuse.
      3. 4.2.3 The controls relationship.
    3. 4.3 Changing the Reading Flow
  5. 5 Document Management
    1. 5.1 Managing Content and Presentational Changes
    2. 5.2 Implementing Live Regions
      1. 5.2.1 5.2.1 Live Region Properties and how to use them
    3. 5.3 Choosing between special case alert, alertdialog, status, and log live regions
  6. 6 Form Properties
  7. 7 Drag-and-Drop Support
  8. 8 Implementation Guidance
    1. 8.1 Common Widget design patterns
    2. 8.2 Common structural widgte design patterns
  9. 9 Reusable Component Libraries
  10. 10 Testing
    1. 10.1 Test case details
    2. 10.2 Test Result Matrix
  11. 11 Appendices
    1. 11.1 Roles, States, and Properties Mapped to Accessibility APIs
    2. 11.2 ToDo List
    3. 11.3 User Agent Implementation Considerations
      1. 11.3.1 Managing Showing and Hiding document sections
      2. 11.3.2 Notification of changes to sections
      3. 11.3.3 ARIA to Accessibility API Events
      4. 11.3.4 Role Mappings
      5. 11.3.5 Mapping to platform accessibility APIs
    4. 11.4 References
    5. 11.5 Acknowledgments
      1. 11.5.1 Participants active in the PFWG at the time of publication
      2. 11.5.2 Other previously active PFWG participants and other contributors to the Accessible Rich Internet Applications specification
      3. 11.5.3 Enabling funders

1 Introduction

This section is informative.

The WAI-ARIA Best Practices guide is intended to provide readers with an understanding of how to use WAI-ARIA to create an accessible Rich Internet Application. As explained in the WAI-ARIA Primer, accessibility deficiencies in today's markup render Rich Internet Applications (RIAs) unusable by people who use assistive technologies (AT) or who rely on keyboard navigation. The W3C Web Accessibility Initiative's (WAI) Protocols and Formats working group (PFWG) plans to address these deficiencies through several W3C standards efforts, with a focus on the ARIA specifications.

For an introduction to WAI-ARIA, see the Accessible Rich Internet Applications Suite (WAI-ARIA) Overview. The WAI-ARIA Best Practices is part of a set of resources that support the WAI-ARIA specification. The Best Practices describe recommended usage patterns for Web content developers, and the WAI-ARIA Primer [ARIA-PRIMER] provides a basic introduction to the concepts behind and reason for ARIA. The WAI-ARIA Suite fills gaps identified by the Roadmap for Accessible Rich Internet Applications (WAI-ARIA Roadmap) [ARIA-ROADMAP]. These documents serve as important places of clarification where topics appear to be unclear.

With the conceptual basis provided in the WAI-ARIA Primer, you should have a good understanding of how ARIA provides for interoperability with assistive technologies and support for a more usable, accessible experience. This guide begins by providing some general steps for building an accessible widget using ARIA, script, and CSS. It then extends your knowledge of ARIA with detailed guidance on how to make RIAs keyboard accessible. Next, the scope widens to include the full application, addressing necessary layout and structural semantics within the web page. These semantics are critical to enable assistive technologies to provide a usable experience when processing RIAs with rich documents on the same page. It includes guidance on dynamic document management; use of ARIA Form properties; ARIA Drag and Drop; and then the creation of ARIA-enabled alerts and dialogs. The appendix provides substantial reference information including code samples for developers of user agents, assistive technologies, and web pages.

2 General Steps for Building an Accessible Widget with ARIA

At this point you should have a basic understanding of how ARIA is used to support interoperability with assistive technologies. If you are not reusing an existing ARIA-enabled widget library and wish to create your own the following steps will guide you through the thought process for creating an accessible widget using ARIA.

  1. Pick the widget type (role) from the ARIA taxonomy

    ARIA provides a role taxonomy ([ARIA], Section 3.4) constituting the most common UI component types. Choose the role type from the provided table. If your desire was to create a toolbar set the role to toolbar:

    <div role="toolbar">
  2. From the role, get the list of supported states and properties

    Once you have chosen the role of your widget, consult the WAI-ARIA specification [ARIA] for an in-depth definition for the role in to find the supported states, properties, and other attributes. For example, the toolbar role definition includes:

    parent role
    In the taxonomy the widget you selected inherits states and properties from this role. In the case of a toolbar you will see that a toolbar is a subclass of a group. This makes sense given that a toolbar is a collection of commonly used functions.
    related concept
    This is really more informative to state what other concepts are similar to this role. These may exist in different host languages outside ARIA.
    supported states and properties
    These are unique states and properties that this widget supports and that were not inherited from its ancestors in the taxonomy. In the case of a toolbar there are no such states or properties. However, in the case of a listbox, you may choose to set the property of multiselectable to true if you were to have more than one tool in the listitem selected at a time. This indicates to the assistive technology that the listbox manages a collection of selectable options.
    inherited states and properties
    These are all the states and properties which are inherited from the roles's ancestors and which you may use.
    global states and properties
    These are states and properties which apply to all host language components regardless of whether a role is set or not. You may use these as well.

    Once you have chosen the states and properties that apply to your widget you must set those properties you will use to their initial values. Note: you do not need to use all the states and properties available for your role. In our case we shall use:

    <div role="toolbar" tabindex="0" aria-activedescendant="button1">

    Here, we have decided that the toolbar will received focus in document order (tabindex="0") and that we will manage which child receives focus when the toolbar receives focus. At this time, we have chosen the first button to be active when the toolbar receives focus. In user agents that support activedescendant, this may cause the user agent to send a focus change event to the first button.


    Important: When embedding WAI-ARIA markeup in (X) HTML, is important that all aria states and properties be preceded by an aria- with the exception of the role attribute and tabindex. Otherwise, the the user agent will not map the WAI-ARIA information will not be recognized by the assistive technologies.

    When embedding WAI-ARIA into other host languges, tabindex does not carry over. The WAI-ARIA tabindex extensions are specific to (X)HTML to repair deficiences in keyboard support.

  3. Establish the widget structure in the markup (parent/child)

    Assistive technologies are very dependent on the structure of widgets as well as general document structure. Structure provides context to the user. A toolbar is a collection of common functions made available to the user. Therefore, all functions you would like in the toolbar must be contained within it. This can be determined by using the document object model structure created by the browser when parsing the host language. For our purposes we will define three image buttons for cut, copy, and paste.

    <div role="listbox" tabindex="0" aria-activedescendant="button1">
    <img src="buttoncut"><img src="buttoncopy"><img src="buttonpaste">
    </div>
  4. Repeat steps 1-3 for the children of the parent

    We now need to assign the roles and states for each of the children. However, we shall save the detailed navigation for step 5.

    <div role="toolbar" tabindex="0" aria-activedescendant="button1">
    <img src="buttoncut.png" role="button" id="button1">
    <img src="buttoncopy.png" role="button" id="button2">
    <img src="buttonpaste.png" role="button" id="button3">
    </div>

    The process of setting roles and states may be a recursive procedure if the children themselves have children, such as in the case of an expandable/collapsible tree widget.

  5. Establish keyboard navigation of the widget and plan for how it will be navigated to within the document

    It is very important that that your widget be keyboard accessible. In fact, there must also be a keyboard equivalent for every mouse mouse operation. Where possible you should refer to the WAI-ARIA examples in this guide for tips on how to implement keyboard navigation for your widget. If you find that an example is not provided, you should follow standard desktop keyboard navigation.

    For our toolbar, we have chosen to have the toolbar manage the focus for its children and through the use of the activedescendant property. We have also chose to have the toolbar receive focus based on the tab order by using tabindex. In order to use activedescendant, each descendant must have an assigned ID.

     <head>
    <script>
    ...
    function optionKeyEvent(event)
    {
    var tb = event.target;
    var buttonid;

    DOM_VK_ENTER = 13;
    // Partial sample code for processing arrow keys

    if (event.type == "keydown") {
    if (event.altKey) {
    return true; // Browser should use this, the menu view doesn't need alt-modified keys
    }
    // XXX Implement circular keyboard navigation within the toolbar buttons

    if (event.keyCode == DOM_VK_ENTER) {
    ExecuteButtonAction(getCurrentButtonID(); // This is an author defined function
    }
    else if (event.keyCode == event.DOM_VK_RIGHT) {
    // Change the active toolbar button to the one to the right (circular) by
    var buttonid = getNextButtonID(); // This is an author defined function
    tb.setAttribute("aria-activedescendant", buttonid);
    }
    else if (event.keyCode == event.DOM_VK_LEFT) {
    // Change the active toolbar button to the one to the left (circular) by
    var buttonid = getPrevButtonID(); // This is an author defined function
    tb.setAttribute("aria-activedescendant", buttonid);
    }
    else {
    return return true;
    }
    return false;
    }
    else if (event.type == "keypress") {
    ...
    }
    }
    </script>

    <div role="toolbar" tabindex="0" aria-activedescendant="button1" id="tb1"
    onkeydown="return optionKeyEvent(event);"
    onkeypress="return optionKeyEvent(event);">
    <img src="buttoncut.png" role="button" id="button1">
    <img src="buttoncopy.png" role="button" id="button2">
    <img src="buttonpaste.png" role="button" id="button3">
    </div>

    The details of implementing keyboard navigation are described in Keyboard and Structural Navigation section of this document.

    Note: You must also show the visual focus for each element that has focus.

  6. Apply and and manage needed ARIA states in response to user input events

    Similar to the processing of activedescendant in Step 5, as author you must set any additional ARIA states and properties on document elements.

  7. Synchronize the visual UI with accessibility states and properties for supporting user agents

    You should consider tieing user interface changes directly to changes in WAI-ARIA states and properties, such as through the use of CSS attribute selectors. For example, the setting of the selected state may change the background of a selected treeitem in a tree. This may also be done with JavaScript.

    .treeitem[role="treeitem"][aria-selected="true"] {color: white; background-color: #222222;}

    .treeitem[role="treeitem"][aria-selected="false"] {color: white; background-color: beige;}

    Authors should be aware that CSS attribute selectors are not supported in some browsers. For example, although it is supported in Firefox 2, it is not in Internet Explorer until version 7. In Internet Explorer 6 or earlier you should set the WAI-ARIA state or property and then apply the updated style information using script. Internet Explorer 7 supports CSS attribute selectors but then you need to refresh the style using element.className +="".The following example shows how to refresh the styling for a change the the selected class attribute in a WAI-ARIA menu item in Internet Explorer 7.

    function setSelectedOption(menuItem)
    {
    if (menuItem.getAttribute("role") != "menuitem") {
    alert("Not a menu item");
    return;
    }
    var menu = getMenu(menuItem);
    var oldMenuItem = getSelectedOption(menu);

    // Set class so that we show selection appearance
    oldMenuItem.removeAttribute("class");
    menuItem.setAttribute("class", "selected");
    menu.setAttribute("aria-activedescendant", menuItem.id);
    menuItem.className += "";
    }

  8. Showing and Hiding Sections in a Widget

    The proper synchronization showing and hiding sections in a widget with the ARIA display state is also critical. Some platform accessibility APIs provide events for applications to notify the assistive technology when pop-ups such as menus, alerts, and dialogs come into view or go away. Rich Internet Applications can assist browsers which support these conventions by:

    1. Creating an entire section and then insert it into the Document Object Model [DOM], as a subtree of the parent element activated to show the pop-up, and then removing the section from the inserted area when the pop-up goes away.

      OR

    2. Using the following style sheet properties to show and hide document sections being used to represent the pop-up items, menus or dialogs:

      • display:block
      • display:none
      • visibility:visible
      • visibility:hidden

      By monitoring these behaviors a user agent may use this information to notify assistive technology that the pop-up has occurred by generating the appropriate accessibility API event.

    Some assistive technologies may use the DOM directly to determine these when pop-up occurs. In this case, the first mechanism of writing a section to the DOM would work using the DOM events. However, if you are using CSS to show and hide sections of the DOM (2) it is essential that you set the corresponding ARIA hidden property to indicate that the section is visible or hidden and synchronize it with your CSS styling as shown here:

    [aria-hidden=true] {visibility: hidden;}

    ...

    <div role="button" aria-haspopup="true" aria-owns="mypopupmenu">
    <div role="menu" aria-hidden="true" id="mypopupmenu">...</div>
  9. Support basic accessibility, such as alternative text on images

    When an image is used to represent information within a component, such as our image buttons, you need to set the alternative text on those images. This is then mapped by the user agent to the accessible name in the platform accessibility API. Using our example:

    <div role="toolbar" tabindex="0" aria-activedescendant="button1" id="tb1" 
    onkeydown="return optionKeyEvent(event);"
    onkeypress="return optionKeyEvent(event);">
    <img src="buttoncut" role="button" id="button1" alt="cut">
    <img src="buttoncopy" role="button" id="button2" alt="copy">
    <img src="buttonpaste" role="button" id="button3" alt="paste">
    </div>
  10. Establish ARIA relationships between this widget and others

    Once you have made the basic widget accessible you may then need to establish its relationship to other widgets. Examples of this are labelledby, controls, describedby and flowto. The details of using these relationships are described in the Relationships section of this document.

    Other relationships which should be considered are more declarative and provide context to the widget within a set. For these, level, posinset, and setsize are provided. If you structure your Document Object Model appopriately so that the user agent can determine this information from it directly, using the DOM hierarchy you do not need to set these properties. There are however, situations in RIAs where all the elements in say are tree are not in the DOM at one time, such as when you can only render the ten of fifty items in a subtree. In this case the user agent cannot determine the number of tree items (setsize) for the position in the set (posinset), and potentially the tree depth (level) from the DOM. In these situations you will need to provide these WAI-ARIA properties.

  11. Review widget to ensure that you have not hard coded sizes

    The ability for applications to respond to system font settings is a requirement. Most user agents are designed to meet this requirement. This also means your web application running within your browser is impacted when the user agent changes the font sizes to meet the need. If you have hard coded your font size in pixels an increase in system fonts will not be reflected in your web application. You must also not hard code the size of your widgets in pixels either. If you make your fonts scaleable and not the widgets, they encapsulated in, the text could flow outsized your widget.

    Follow these rules to allow your application to respond to system font settings:

    • Establish a base set of font sizes and widget sizes based on em height
    • Ensure that all fonts used are a function of this base em height
    • Make sure all widgets are a function of the base em height

    An em is a is the font unit of measure between the top and bottom of an upper case letter M. This is independent of the scale which the font is reproduced. Often, the user agents font adjustment to system settings, are such that they are defined using the font's internal metrical units (font units), which are specified as units of the total body or em height of the font, hence em units. Em can be used as a proportional unit of length in CSS to scale properties in relation to the default font size settings in a users' browser.

    Important: Most browsers today have a zoom feature which allow the user to magnify the entire web page. Most legislation today requires that your application respond to system font and color settings and therefore you will want to consider the fact the system settings could adversely effect your web page should you decide to hard code pixel sizes.

  12. Test with User agent, Assistive Technology, and People with disabilities

    To ensure you have set your WAI-ARIA semantics correctly, test your application with your user agent, an assistive technology, and a person with disability. Example assistive technologies are screen readers and screen magnifiers. Ensure that your user agent is designed to support WAI-ARIA and their your assistive technology is designed to support ARIA in the selected user agent.

    Finding people with disabilities to do testing may be difficult but many companies employ people with disabilites, including your customers, and you should reach out to them to ask for help. Other places to look are advocacy groups like the National Federation of the Blind or your local schools for the blind, reading and learning centers, and so on. The people you reach out to may someday need to use what you produce.

3 Keyboard and Structural Navigation

Provide an effective navigation experience to the user is critical for usability. This section starts with guidance on how to provide effective keyboard navigation for widgets in a Rich Internet Application environment. This includes a discussion on how to manage keyboard focus and the specifics on providing keyboard navigation for tooltips. This is is followed by a broader discussion on how to convey structural semantics for the entire web page so that an assistive technology can provide additional navigation, to increase productivity, and rendering the page to the end user in an alernative format. This rendering may be in different forms, including but not limited to speech, page restructuring, and alternative input solutions.

3.1 Providing Keyboard Navigation for Widgets

3.1.1 ARIA Keyboard Bindings and Behaviors

Essential to accessible Web 2.0 widgets is keyboard support to provide full operation and functionality of a widget through keyboard-only events. Unlike traditional HTML form controls, Web 2.0 widgets, typically, have no inherent keyboard support. The developer must enable keyboard support for the widgets they create or use widget libraries with keyboard support. The best practices model for keyboard support for Web 2.0 widgets are graphical user interface (GUI) operating systems like Microsoft Windows®, Apple OSX®; and UNIX Desktops like GNOME and GTK. Two basic accessibility requirements for keyboard focus include:

  • Support users who cannot use pointing devices due to physical or visual impairment to access the full functionality of the Web application.
  • All major software and web accessibility guidelines for people with disabilities require keyboard-only operation of the interface for accessibility.
  • Communicate accessibility information to assistive technologies on the type of widget and its associated state and properties.

3.1.2 Keyboard Navigation between Widgets

The tabindex attribute enables focus to be moved via keyboard to HTML elements used to create Web 2.0 widgets.

  • Tab and Shift+Tab key move focus among widgets and standard HTML controls.
  • Widgets with tabindex=0 will be added to the tab sequence based on document order
  • Widgets with tabindex>0 will be added to the tab sequence based on the TABINDEX value
  • Widgets with tabindex<0 will not be added to the tab sequence but are enabled to receive keyboard focus.

Once a widget has keyboard focus, arrow keys, Spacebar, Enter key, or other keyboard commands can be used to navigate the options of the widget, change its state, or trigger an application function associated with the widget.

3.1.3 Keyboard Navigation within Widgets

Each element that receives keyboard focus needs to have a tabindex attribute set to its current active desendant element and itself if an active desdendant does not exist. The element with keyboard focus is essential because it communicates information about the widget to assistive technologies like screen readers and magnifiers through operating specific accessibility APIs like Microsoft Active Accessibility (MSAA), the Apple Universal Accessibility API, and the ATK Accessibility Toolkit. The TAB key moves keyboard focus to the widget, and other keys operate the features of the widget, typically cursor keys, Enter key and Spacebar. The actual keys are up to the developer, but best practices recommend using the same key bindings that are used to control similar widgets in common GUI operating systems like Microsoft Windows®, Apple OSX® and UNIX Desktops like GNOME and GTK.

JavaScript can use either the focus() method to move focus to the appropriate element in the widget, or it can use an ARIA property called "activedescendant" on the actual widget container to indicate which element in the widget must have focus. The following procedure should be followed when focus is completely dependent on the use of tabindex to provice focus in a widget:

  • Set tabindex="0" to the current active descendant in the widget while setting tabindex="-1" on all the other child elements of the widget
  • As the user navigates (e.g. arrows) away from an item, the old item gets a tabindex="-1" and the new item gets tabindex="0".
  • Use the javascript method to set focus, using its JavaScript focus() method, on the item whose tabindex="-1"

This procedure creates a roving tabindex. If you tab away and tab back to the widget the same last active descendant becomes active again. This relieves the author from having to compute and set the focus to the last activedescendant.

Conversely, if you use the WAI-ARI activedescendant property things get a lot easier:

  • Set tabindex="0" on the element which represents a widget and set its activedescendant property to the id of the child you wish to be active
  • As the user navigates (e.g. arrows) away from an item in the widget refresh the activedescendant property on the containing widget to the id of the new active descendant child.

The browser will then be responsible for managing focus changes for you.

In both scenarious the author must indicate through styling and/or markup which element in the widget has focus or is "active."

3.1.4 Example Keyboard Operation: Radio Group/Radio

See working Radio button examples from the University of Illinois.

Key Bindings for Radio Group Behavior - Example
Key Description of Radio Group Behavior
Tab Key If no radio buttons is checked, focus moves to the first radio button in the group, but the radio button remains unchecked. If one radio buttons is checked, focus moves to the checked radio button. If SHIFT+TAB is pressed, focus moves to the last radio button in the group, but the radio button is not checked
Space Bar Checks the radio button with keyboard focus (this is a special case when using tab and no radio buttons have been marked as checked)
Down Arrow Move the checked radio button to next radio button. If no button is checked, check the first radio button. If the last radio button is checked, check the first radio button
Up Arrow Move the checked radio button to previous radio button. If no button is checked, check the last radio button. If the first radio button is checked, check the last radio button

In this Radio Group example, the tabindex of the radiogroup element initially has tabindex="0" (assuming none of the radio buttons is checked), the radio elements have tabindex="-1". As soon as one of the radio buttons is checked, the radio group element changes its value of tabindex="-1", the radio element that is checked changes its value to tabindex="0", and all other radio buttons have a tabindex ="-1".

3.1.5 Other Widget Best Practices

For specific keyboard navigation, see the Common Widget Design Patterns section.

3.1.6 Validation Issues

WAI-ARIA markup is currently not included in (X)HTML. The W3C WAI PF working group will be creating DTDs for XHTML 1.0 and HTML 4.01 for those wishing to validate their markup with WAI-ARIA embedded into these host languages.

3.2 Providing Keyboard Focus

One way to provide keyboard support in (X)HTML is with form and list elements that accept keyboard focus by default. With the Tab key, the user can navigate to these types of elements. However, when building sophisticated widgets it's necessary to be able to control keyboard navigation exactly and authors may require or prefer to use plan host language elments that do not have built-in keyboard navigation features. For example, the author may wish to provide keyboard navigation without impacting the tab order. Navigating within large composite widgets such as tree views, menubars, and spreadsheets can be very tedious and is inconsistent with what users are familiar with in their desktop counterparts. The solution is to provide full keyboard support using the arrow keys to provide more intuitive navigation to provide navigation within the widget, while allowing Tab and Shift+tab to move out of the widget to the next place in the tab order.

A tenet of keyboard accessibility is reliable, persistent indication of focus. The author is responsible, in the scripts, for maintaining visual and programmatic focus and observing accessible behavior rules. Screen readers and keyboard-only users rely on focus to operate rich Internet applications with the keyboard.

3.2.1 Tabindex

One requirement for supporting the keyboard is to allow focus to be set to any element. The tabindex attribute can be used to include additional elements in the tab order and to set programmatic focus to them. Originally implemented in Internet Explorer 5, the feature has been extended to Opera, Firefox, and Mozilla. The following table outlines the use of the tabindex attribute:

Use of the Tabindex Attribute
Tabindex Attribute Focusable with mouse or JavaScript via element.focus() Tab Navigation

not present

Follows default behavior of element (only form controls and anchors can receive focus.) Follows default behavior of element

zero - tabindex="0"

yes In tab order relative to element's position in document

Positive - tabindex="X" (where X is a positive integer between 1 and 32768)

yes Tabindex value directly specifies where this element is positioned in the tab order.

Negative - tabindex="-1"

yes No, author must focus it with element.focus() as a result of arrow or other key press

Setting a tabindex value of -1 to an element allows the element to receive focus via JavaScript using the element.focus() method. This method is used to enable arrow key navigation to elements. Each element that can be navigated to via arrow keys must have a tabindex of -1 to enable it to receive focus. Here are just a few additional tips to help you with managing keyboard focus:

  • Use onfocus to track the current focus - The events onfocus and onblur can now be used with every element. There is no standard DOM interface to get the current document focus, so if you want to track that you'll have to keep track of it in a JavaScript variable. Don't assume that all focus changes will come via key and mouse events, because assistive technologies such as screen readers can set the focus to any focusable element, and that needs to be handled elegantly by the JavaScript widget.

  • Follow keydowns to move focus - A keydown event handler can determine the next object to receive focus and call that element's focus() method.

  • Use onkeydown to trap key events, not onkeypress - Internet Explorer will not fire keypress events for non-alphanumeric keys.

  • Refresh an elements style using onfocus() - An element's style may require an update via an onfocus event handler in order to show the focus, because browsers are inconsistent in displaying focus for items that receive focus programmatically.

  • Dynamically change focusability using the tabIndex property - You may want to do this if a custom control becomes disabled or enabled. Disabled controls should not be in the tab order. However, you can typically arrow to them if they're part of grouped navigation widget.

  • Use setTimeout with element.focus() to set focus - Do not use createEvent(), initEvent() and dispatchEvent() to send focus to an element, because DOM focus events are considered informational only -- generated by the system after something is focused, but not actually used to set focus. The timeout is necessary in both IE and Firefox 1.5, to prevent scripts from doing strange unexpected things as the user clicks on buttons and other controls. The actual code to focus an element will look something like this:
    window.setTimeout(function () { focusItem.focus(); },0);  // focusItem must be in scope
  • Don't use :focus or attribute selectors to style the focus - You will not be able to use :focus or attribute selectors to style the focus if you want the focus to appear in Internet Explorer. Set the style in an onfocus event handler. For example, in a menu item's focus handler add this.style.backgroundColor = "gray";

  • Always draw the focus for tabindex="-1" items and elements that receive focus programatically - Internet explorer will not automatically draw the focus outline for items that programatically receive focus. Choose between changing the background color via something like this.style.backgroundColor = "gray"; or add a dotted border via this.style.border = "1px dotted invert". In the dotted border case you will need to make sure those elements have an invisible 1px border to start with, so that the element doesn't grow when the border style is applied (borders take up space, and IE doesn't implement CSS outlines).

  • Prevent used key events from performing browser functions - If a key such as an arrow key is used, prevent the browser from using the key to do something (such as scrolling) by using code like the following:
    <span tabindex="-1" onkeydown="return handleKeyDown();">   

    If handleKeyDown() returns false, the event will be consumed, preventing the browser from performing any action based on the keysroke.

  • Use key event handlers to enable activation of the element - For every mouse event handler, a keyboard event handler is required. For example, if you have an onclick="doSomething()" you may also need onkeydown="return event.keyCode != 13 || doSomething();" in order to allow the Enter key to activate that element.

  • Consider using a "roving" tabindex for complex widgets if you are not using the activedescendant property.

3.2.2 Using activedescendant vs. tabindex for to manage focus of widget children

ARIA provides two techniques for managing the focus of child elements within a widget. Widgets like grid and tree typically manage their children. The root element of the widget should have a tabindex value greater than or equal to "0" to ensure that the widget is in the document tabbing order. Rather than setting a key event handler on each element within a larger component, the event handler can be set on the parent element such as the tree. It will be job of the parent element to manage the focus of the children.

The parent may use the activedescendant property to indicate the active child. For example, the container element with the role of tree can provide an onkeydown event handler so that each individual tree item within the tree does not need to be focusable and to listen for the keydown event. The container object, in this case the tree, needs to maintain the point of regard and manage which individual child item must be perceived as active.

Important: For a given container widget where activedescendant must cause focus events to be fired to ATs, the actual focus must be on the container widget itself. In HTML this is done by putting tabindex="0" on the container widget.

The key handler on the parent captures the keystrokes and determines what item becomes active next and updates the activedescendant property with the ID of the appropriate, next active child element. The browser takes that ID information and generates the focus event to the assistive technology. Each individual element does not have to be made focusable via a tabindex value of -1, but it must be styled using CSS to indicate the active status

An alternative to using activedescendant is to have the parent element, in response to the same keyboard input, move focus to its children by first removing tabindex from children that do not have focus, which removes them from the tab order. This would be followed by setting the tabindex to "-1" on the element which is to receive focus and then using script to set focus on the element to receive focus. Like with activedescendant this leaves managed children out of the tabbing order. For browsers which do not yet support activedescendant, this allows keyboard navigation to be maintained and it will provide focus notification to many assistive technologies like screen magnifiers to move visual focus and which are not reliant on other ARIA properties. Today, this technique will work in more user agents, but in the long run activedescendant will require less work by the developer.

3.2.3 Author-Defined Keyboard Short-Cuts or Mnemonics

Author-defined keyboard short-cuts or mnemonics present a high risk for assistive technology users. Because they are device-, browser-, and AT-dependent, conflicts among key bindings is highly probable. However if you needed to use one use accesskey. You should be aware that it will behave differently in
different browsers. It also may not work with small devices so it is still advisable to ensure that all features are accessible with the basic keys like Tab/shift+tab, arrow, Enter, space and Escape.

The XHTML 2 Working Group is currently developing a new Access Module to address this issue and we hope to have it or a feature like in future versions of (X)HTML. Refer to Section 9: Implemenation Guidance.

3.3 Supporting Tooltips with the Keyboard

A tooltip is a popup messages typically triggered by moving a mouse over a control or widget causing a small popup window to appear with additional information about the control. If you want to have simple text tooltips the HTML title attribute should more than suffice as the user agent will render this for tooltips. When creating a tooltip it is essential that the user must be able to activate it using the keyboard. When a form control or widget receives keyboard focus, the tooltip must display. When the form control or widget loses focus, the tooltip must disappear.

The following is a code snippet of working tooltips from the iCITA site.

<html lang="en-us">  
<head>
<title>inline: Tooltip Example 1</title>
<link rel="stylesheet" href="css/tooltip1_inline.css" type="text/css">
<script type="text/javascript" src="js/tooltip1_inline.js"></script>
<script type="text/javascript" src="../js/widgets_inline.js"></script>
<script type="text/javascript" src="../js/globals.js"></script>
<link rel="icon" href="http://www.cites.uiuc.edu/favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="http://www.cites.uiuc.edu/favicon.ico" type="image/x-icon">
</head>
...

<body onload="initApp()">

<div id="container">

<h1>Tooltip Example 1</h1>
<h2>Create Account</h2>
<div class="text">
<label for="first">First Name:</label>

<input type="text" id="first" name="first" size="20" onfocus="tooltipShow(event, this, 'tp1')"
onmouseover="tooltipShow(event, this, 'tp1')"
aria-describedby="tp1"
aria-required="false"/>

<div id="tp1" role="tooltip" aria-hidden="true">Your first name is a optional </div>
</div>
...

3.4 Providing Navigable Structure within Web Pages

This section takes a broader look at the web page. It is intended to assist you in conveying a logical, usable, and accessible layout to an assistive technology or adaptive system designed to modify the visual layout to meet the users needs. 

One of the deficiencies of (X)HTML for disabled users has been the usability of keyboard navigation. Users, dependent on a keyboard for navigation, have been forced to tab everywhere in the document as the only document elements which are keyboard accessible are form and anchor elements. This has forced developers to make most everything a link to make it a keyboard accessible and to get to each link you have to tab to it. With the advent of portals and other content aggregation means web pages are divided into visible regions and there has been no vehicle to get to them other than perhaps to do things such as:

There are three problems with this approach:

3.4.1 Steps for defining a logical navigational structure

Follow these steps to mark up each logical section:

  1. Identify a the logical breakdown structure of your page

    Break up your page into perceivable block areas which contain semantically associated information called "regions". You can further breakdown each region into logical regions as needed. This is a common process undertaken by portal developers who break the page into perceivable regions called portlets. Think about the user wanting to navigate to these logical block areas on your web page. Write down a description of what you believe each region to be.

    Depending on your web application you may then need to break it into sub regions depending on the complexity of your web application. This is a recursive process. A user will look at these perceivable areas like pealing an onion. You might have an outermost collection of perceivable regions or block areas and upon entering each region you may have a collection of regions within it.

  2. Implement the logical structure in markup

    Implementing the block structure in markup often involves wrapping elements contained with a "region" such as a <div> or <iframe> with perceivable borders so that each perceivable region or block area is perceivable to the user.

  3. Label each region

    Once you have broken up each region you need to label it. The start of each region should have a perceivable header and it should be used to label the region. For details on how to do this see section 3.4.3.1 Header Levels vs. nesting level to create a header to label each region. If you're finding it difficult to come up with a label for the region, make sure at least to use one of the standard roles defined in the following step. The drawback of not providing a label is that users will not know the purpose of the region. By definition, regions would be included in a summary of a page. If an assistive technology were to summarize it would be unable to provide information about the section without a label.

  4. Assign landmark roles to each region

    Now that you have your regions labelled you need to assign them semantic navigation landmarks. Landmarks are a vast improvement over the rudimentary "skip to main content" technique employed prior to WAI-ARIA. If possible it is best to use these as landmarks. Skip to main content links impact the layout of applications and only address one main content area. WAI-ARIA provides a collection of landmarks which are applied to each of the regions you identified in step 2.

    The presence of common, semantic, navigation landmarks allows each site to support the same standard and allows your your assistive technology to provide a consistent navigation experience - an important feature for screen readers and alternate input solutions. For users with cognitive and learning disabilites the landmark information could be used to expand and collapse these regions of your page to aid in simplifying the user experience by allowing the user to manage the amount of information processed at any one time.

    There are also mainstream benefits of providing navigation landmarks. Your browser may assign key sequences to move focus to these sections as they can be set on every site. Navigation to these landmarks is device independent. A personal digital assistant (PDA) could assign a device key to get to them in your document. These are the common landmarks included in WAI-ARIA.

    article

    Represents a section of a page consisting of a composition forming an independent part of a document, page, or site.

    An article could be a forum post, a magazine or newspaper article, a Web log entry, a user-submitted comment, or any other independent item of content. It is "independent" in that its contents could stand alone, for example in syndication. However, the element is still associated with its ancestors; for instance, contact information that applies to a parent body element still covers the article as well. When nesting articles, the inner articles represent articles that are in principle related to the contents of the outer article. For instance, a Web log entry on a site that accepts user-submitted comments could represent the comments as articles nested within the article for the Web log entry. Author, heading, date or other information associated with an article does not apply to nested articles. Assistive technologies must treat and article like a document in that article must must be processed like an application. Unlike a document, the use of articles allows the user to identify them and follow related articles based on the nesting. region that contains the prime heading or internal title of a page. Most of the content of a banner is site-oriented, rather than being page-specific. Site-oriented content includes things such as the logo of the site sponsor, the main heading for the page, and site-specific search tool. Typically this appears at the top of the page spanning the full width.

    banner

    A region that contains the prime heading or internal title of a page. Most of the content of a banner is site-oriented, rather than being page-specific. Site-oriented content includes things such as the logo of the site sponsor, the main heading for the page, and site-specific search tool. Typically this appears at the top of the page spanning the full width.

    complementary

    Any section of the document that supports but is separable from the main content. There are various types of content that would appropriately have this role. For example, in the case of a portal, this may include but not be limited to show times, current weather, or stocks to watch. The content should be relevant to the main content; if it is completely separable, a more general role should be used instead.

    contentinfo

    Meta information about the content on the page or the page as a whole. For example, footnotes, copyrights, links to privacy statements, etc. would belong here.

    main

    Main content in a document. This marks the content that is directly related to or expands upon the central topic of the page.

    navigation

    A collection of links suitable for use when navigating the document or related documents.

    search

    The search tool of a web document. This is typically a form used to submit search requests about the site or to a more general Internet search service.

    To set the landmark in you page:

    <div role="main"> ... <div role="complementary" title="weather">  
  5. For the landmarks that just won't fit use the region or specialized region ARIA roles

    If you would like to use create your own custom regional landmarks you can by making use of any one of the following WAI-ARIA regions and labelling them with a title attribute or :

    It is not essential to label these specialized regions when they are used as a widget such as in the case of log and status but you should provide a title. When using the region role you should label the region with a header so that the name of the region is accessible to all users just as you would the standard regional landmarks. See Header levels versus Nesting levels for directions on how to label the region.

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

    Note: the region role is generic and a more specific role should be used if applicable. should only be used as a last resort. It shall be treated as a complemenatary region by an assistive technology.

  6. Indicate to the assistive technology who controls the keyboard navigation

    Today's screen readers for the blind have been designed to give the user a "browsing" experience meaning the screen reader consumes a number of keys to aid in the browsing experience. For example, the "up" and "down" arrow keys are used to read the next and previous line of text on your web page. Accessible Rich Internet Applications will use these keys in an application to navigate within "widgets" like a Tree View.

    Assistive technologies must be able to identify widgets and which implement WAI-ARIA and allow them control use the keyboard. However, if you have used a used numerous widgets to form an application you must set the role on the larger region application and if you need to switch back occassionally to a document role you can. See section 3.4.2 Structural Roles used to facilitate assistive technology navigation.

3.4.2 Structural roles used to facilitate assistive technology navigation

While ARIA is designed to address many disabilities, this section is best described in terms of screen reader use. In desktop applications, screen readers typically treat widgets as discrete entities, reading and interacting with each widget one at a time. The user moves the point of focus from widget to widget using tab/shift tab, mnemonics, or accelerators, keyboard commands which are usually provided by the application or the operating system. We refer to this mode of interaction as "application mode."

When viewing web content however, screen readers often gather information about all the widgets in an area and present them in a document-like view which the user navigates using keyboard commands provided and controlled by the screen reader. Think of this mode as a virtual environment that presents web content in a way that makes it convenient for adaptive technology users to navigate and read. This is sometimes called browse mode, or virtual mode. We refer to this as "document browse mode."

Because screen readers often provide document mode navigation support using single key mnemonics on the alpha-numeric keyboard, they may provide a third mode, called "forms mode," used to interact with form controls that are encountered in document mode. Behavior in forms mode is similar to that of application mode. The key feature of forms mode is that it can be toggled with document mode to make it easy to both interact with a specific widget, and read virtualized content of which the widget is a part. Since, as described above, a screen readers perception of an area as either a document or an application greatly influences how the user reads and interacts with it, ARIA provides content authors a way to indicate whether their pages must be viewed as applications or documents by assistive technologies.

To set document or application mode follow these steps:

  1. Set the Application Role

    After you have divided your web page into regions through the use of role landmarks and custom regions, you must make a decision: Is your web page an application or not? If it is, set the role of application on the body tag as follows:

    <body role="application"> 

    When using application, all static text must be associated with widgets, groups or panes via using the labelledby and describedby properties, otherwise it will not be read by the screen reader when the user navigates to the the related widget or group.

    Special Considerations:

    • If you have selected to have a role of application on the body tag it is recommended that a widget have focus after the page is first loaded.
    • If when your page loads and you should have have focus on a widget this is a strong indicator that your web page should have role of application.
    • If your page has only a few isolated widgets, like pop-up calendars located on a web page, it is not necessary to expressly set the role of application on the body. Screen readers, based on widget roles, must be able to provide access to these widgets without recognizing the entire page as an application.
    • Also, browsers make use of a feature called the contenteditable attribute, which will be incorporated into HTML 5. Contenteditable allows an author to turn the browser section into a rich text editor, similar to a word processor. Any section which has contenteditable set to "true" is considered a widget.
    • If the body element has been given the role of application, please follow step 3. Otherwise, the web page is considered a document, and no further action is required in this regard.

  2. Dialogs and Alert Dialogs - special case application roles

    WAI-ARIA provides dialog and alertdialog roles which are to be treated as special case application roles. Like application, screen readers will leave the main job of keyboard navigation up the the application.

    When using dialog, all static text must be associated with widgets, groups or panes via using the labelledby and describedby properties, otherwise it will not be read by the screen reader when the user navigates to the the related widget or group. Unlike an application, your web page is unlikely to start out as either of these two roles but rather the author is most likely to dynamnically create dialogs or alertdialog sections within the web page.

    Unlike dialog, descriptive text of the alert does not need to be associated via a relationship as the contents of alert dialogs will be read automatically by the screen eader when the dialog opens.

  3. Set the Document Role

The default mode for a screen reader to be processing an HTML web page is document browse mode. This is equivalent to having a role of document on the HTML <body> tag. If you have already specified a role of application on the body tag there may be times in which you tell the screen reader to switch into "document browse mode" and start stealing the necessary keys to browse a document section of your web page. These keys are the typical keys used by WAI-ARIA widgets and to provide this level of navigation the keys must be stolen from your browser.

To mark areas of your page to tell the assistive technology when to switch into document browse mode, look at the regions/landmarks you have defined and determine which ones must be browsed as a document or navigated as an application. For each region which must be browsed in document browse mode, embed a div element within it with the role of document as follows:

<div role="document"> 

Now, when a screen reader encounters this region, it will change its interaction model to that of document browsing mode.

3.4.3 Implicit Nesting and Headings

This section discusses the use of the heading role and nesting levels.

3.4.3.1 Header Levels versus Nesting Levels

The heading role value signifies a heading for a section of the document instance. Use of the heading role indicates that a specific object serves as a header. The region of the document to which the heading pertains to should be marked with the labelledby property containing the value of the id for the header.. If you have a heading and there is no element containing the content that it heads, wrap the content in a <div> bearing this labelledby attribute. If headings are organized into a logical outline, the level property can be used to indicate the nesting level. Here is an example:

<p role="main" aria-labelledby="hdr1">

<div role="header" id="hdr1">
Top News Stories

</div>

</p>
3.4.3.2 Owns Repairs Nesting

Assistive technology briefs users on the context where they are. When they arrive at a new page, a page summary may be given. When they move into a new context, some of the labeling from elements containing the new focus or reading location may be rendered by the assistive technology, to give context to the details to be read next.

The syntactic structure of a page provides the default nesting of contexts. If a paragraph is nested in a <div> or table cell, it is assumed that labels for the <div> or headers for the table cell are pertinent to what is in the paragraph. On the other hand, it is not possible to always flow the logical structure one-to-one into the parse structure.

The owns relationship is provided to annotate logical nesting where the logical child is not a syntactic descendant of the logical parent. In a Rich Internet Application, updates may be made to the the document without updating the logical synctactic structure, yet elements may appear to be added to the document structure. From a DOM and accessibility hierarchy perspective owns is a fallback mechanism to using the tree hierarchy provided in the DOM. An example of where owns is needed is a treeitem children where, children in a folder subtree are added to a visible subtree but not be reflected in the actual document subtree of the folder. The owns relationship can be used to associate the folder with new "adopted" child. For more details on thue use of owns see section 4.2 Owning and Controlling. The owns relationship is used to indicate to a user agent that a menu is an adopting parent of a sub menu. Another use for owns is a hierarchical diagram where the child nodes of the diagram are not be adequately represented using the DOM structure.

3.4.4 Grouping, Regions, and Directories

3.4.4.1 Groups and their applicability

A group is a section of related user interface objects which would not be included in a page summary or table of contents by an assistive technology. Sections of user interface objects that should be included in a page summary or table of contents must be identified as a type of region. Unlike a group, A heading is used to label a section which forms a region. The region and its heading are normally perceivable in the context of the document.

Authors should use a role of group to form logical collections of items in a widget such as a:

  • a row in a grid;
  • a group of children in a tree widget forming a collection of siblings in a hierarchy; or
  • a group of items having the same container in a directory

Proper handling of group by assistive technologies, therefore, is determined by the context in which it is provided. Group members that are outside the DOM subtree of the group need to have explicit relationships assigned for them in order to participate in the group. Groups may also be nested.

If an author believes that a section is significant enough in terms of the entire document instance, then the author must assign the section a role of region or a standard XHTML Role landmark.

3.4.4.2 Regions vs. groups

The term region defines a group of elements that together form a large perceivable section of a document instance, which the author feels must be included in a summary of page features, such as a "Table of Contents" or "Summary of Regions."

When defining a region for a section of a document, authors must consider using standard document landmark roles defined by the XHTML Roles Module. This makes it possible for user agents and assistive technologies to treat roles as standard navigation landmarks. If the definition of these regions is inadequate, authors must use the ARIA region role and provide the appropriate title text. For more information on the use of region see Regions and XHTML Role landmarks.

3.4.4.3 Directories and their applicability

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</li>
<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>

3.4.4.3.1 Use of the presentation role vs. CSS

An element whose role is defined as presentation does not need to be mapped to the accessibility API. The presentation role's intended use is to mark an element which is used to change the look of the page, such as a TABLE used to control layout, but which does not have all the functional, interactive, or structural relevance implied by the element type for which the presentation role is defined.

A user agent may remove all structural aspects of the element being repurposed. For example, a table marked as presentation would remove the table, td, th, tr and any other child elements of TABLE, while preserving the individual text elements within it. Because the user agent knows to ignore the structural aspects implied in a TABLE, no harm is done by using a table for layout.

The following is an example for using the ARIA presentation role to convey layout:

<table role="presentation">
<tr>
<td>see</td>
<td>spot</td>
<td>run</td>
</tr>
<tr>
<td>over</td>
<td>the</td>
<td>lazy coder</td>
</tr>
</table>

All descendants of the element having a presentation role are still exposed, with the exception of table rows and cells on a table. So, if you were to have forms, images, and text within a table and the table had a role of presentation these elements would be exposed.

3.4.5 Remaining structural roles

3.4.5.1 Tabular structure related roles supporting tabular widgets

There are a number of structural roles which are used to support tabular widgets grid and treegrid which indicate additional keyboard navigation as well as the ability to select rows and/or columns. Typically, you would apply these roles to an underlying table in the base markup as shown here:

<table role="grid">		

However, in some instances that may not work for the developer, such as when the developer has need for a <div> or <span>, or additional semantics may be needed. To assist, the following roles are provided to support tabular widgets:

When constructing a grid or treegrid the author must use gridcell's for the actual cells:

<table role="grid">
<tr>
<td role= "columnheader">Apples</td><td role= "columnheader">Oranges</td>
</tr>
<tr>
<td role="gridcell" aria-readonly="false">Macintosh</td><td role="gridcell">Valencia</td>
</tr>
</table>

Gridcells are focusable within a grid unlike a table. They may also be editable as is shown in the above example.

Treegrid's may require expanding and collapsing rows which may not be performed using a <tr>. In these instances authors will use an HTML <div>. ARIA provides a role of row which may be assigned to the div to convey to the assistive technology that this is still a row.

3.4.5.2 Marking Description sections

A new feature of ARIA is the ability to mark a description in your document that can then be associated with a section, drawing, form element, picture, and so on. This is unlike longdesc which typically required the author to create a separate file to describe a picture when it was preferred to have the descriptive text in prose as well so that it was readily available to all users.

<img src="foo" alt="" aria-describedby="prose1">

<div role="description" id="prose1">
This prose in this div describes in detail the image foo.
</div>

This is the preferred vehicle for providing long descriptions for elements in your document.

4 Relationships

4.1 Labeling and Describing

Marked up content or widgets will often need additional context to make clear what the meaning or purpose is. It is also reasonable that some content media types will need additional descriptions in another format to give clarity to those who are unable to consume the origin format. These additional meta-content sections are linked together by tagging them as labels or descriptions. ARIA provides the labelledby and describedby attributes to signal the browser to feed these relationships into the accessibility layer. This layer is then used by screen readers and other accessibility technology (AT) to gain awareness of how disparate regions are actually contextually connected to each other. With this awareness the AT can then present a meaningful navigation model for discovery and presentation of these additional content sections. The user agent itself can also choose to present these insights in a meaningful way. Generally you should always add these attributes to any widgets on your site as they are often merely a construct of HTML and JavaScript which provides no obvious insight as to what the widget's behavior or interactivity is.

4.1.1 Labelled By

A labelledby section needs to indicate what the object it labels does. For example, you could have a button in a webmail client which will erase a selected message. This button could be constructed out of any kind of HTML but with with the ARIA roles, states and other attributes the user will know it is a button. The button itself should have a basic behavioral explanation, such as "erase mail" but the user might not be familiar with this feature or webmail in general, so providing additional behavioral labeling will reduce fear and make the page more user friendly. The markup could look like this

<div role="button" aria-labelledby="eraseButton" tabindex="0">Erase Message</div> 

and elsewhere in the markup

<div id="eraseButton">Permanently erase the currently selected message titled "Nigerian Lottery"</div> 

This would give the user and any running AT additional information about the expected behavior if the button widget is activated. In this particular case, the <div> content has been updated to reflect the current context to make it more obvious exactly what the effect of the action will be. The section doing the labeling might be referenced by multiple widgets or objects as these need only reference the same id, so contextual description may not always be viable. The labelledby attribute can have multiple ids specified as a space separated list much like applying multiple classes to a single DOM object.

It should be noted that (X)HTML provides a <label for> element which you can use to label form controls. For all visual objects, including (X)HTML form elements, you should may the WAI-ARIA labelledby property for labelling.

4.1.2 Described By

A describedby section provides further information about a given object or widget, which may not be intuitively obvious from the context, content or other attributes. For example, a fake window is a common widget used in web applications and is often constructed using a div absolute positioned in a layer above other content. To simulate common window behavior look and feel there is often an X box in the corner which, when activated, dismisses the window widget. One common way to make this X box is to simply make a link whose content is an X. This doesn't give a non-visual user much to go on and belies the real purpose of the X link. To help we add more descriptive text stored elsewhere in the page like this:

<a role="button" aria-describedby="winClose" href="#" onclick="fakewin.close()">X</a> 
and then elsewhere in the HTML
<div id="winClose">Closing this window will discard any information 
entered and return you back to the main page</div>
Like labelledby, describedby can accept multiple ids to point to other regions of the page using a space separated list. It is also limited to ids for defining these sets. In our contrived example we would also want a good labelledby section to fully explain what the window does and how closing will effect the task being worked on. If an object or widget lacks describedby the user agent or AT may try to extract information from the label or th tags, if present. The label and th tags have limited use in that they can only be applied to forms or tables, respectively.

ARIA also defines the description and tooltip roles to which describedby may reference to assign a description (which could span multiple document elements) and an author defined tooltip. The assistive technology can can tell from the type of object describing the document element what the purpose of that element is. For example, a screen reader could announce the tooltip without the user having to waive the mouse over the element by following the describedby relationship to a document area with a tooltip role. The describedby property is also useful for describing groups.

Here is a code snippet showing a set of the tooltip:

...    
<div class="text">
<label for="first">First Name:</label>
<input type="text"
id="first"
name="first"
size="20"
onfocus="tooltipShow(tooltip1)"
onblur="tooltipHide(tooltip1)"
onmouseover="tooltipShow(tooltip1)"
onmouseout="tooltipHide(tooltip1)"
aria-describedby="tp1"
/>
<div id="tp1" class="tooltip" role="tooltip">Your first name is a optional</div>
</div>
...

4.2 Owning and Controlling

Two relationships expand the logical structure of a WAI-ARIA Web application. These are owns and controls .  The owns relationship completes the parent/child reltionship when it cannot be completely determined from the DOM created from the parsing of the markup. The controls relationship defines a cause and effect relationship so that assistive technologies may navigate to content effected by and changes to the content where the user is operating.

4.2.1 The owns relationship.

Assistive technologies are dependent on knowing the parent, or owner, of an object the person is working on to provide context where the user is operating. Typically, this can can be determined from a parsing of your web page into a DOM, forming of a tree hierarchy, that allows an assistive technology to request the "parent" of the the object they are working on. An example where this is important is a treeitem. Here, the user often asks for the the container parent such as a folder name. In rich internet applications, only a subset of the treeitems may be available at any one time and they may be added dynamically without modification to the DOM tree hierarchy - a common occurence in Ajax applications.

WAI-ARIA allows the the author to identify "adopted" children solution through the use of the owns property. The owns relationship property establishes owernship of an element when applied to an element in the web page.  In these situations, adopted children are visually rendred to be contained in or managed by a "perceived" parent when actually they are not natural children as would be found in a parsed DOM. The owns attribute must appear on any element whose logical contents includes elements nested within it and also other content not found among its syntactic descendants (determined from the DOM). The value of the attribute is a list of 'id' attribute values for the additional logical children that are not syntactic descendants. Let us call the elements whose IDs appear in the 'owns' attribute value as the adoptive children and the children by textual inclusion natural children.

Natural and adopted children must be presented to users in a way such that the user will perceive them to be part(s) of the logical parent and peers of each other. Each child, adopted or natural, should each have the appropriate posinset and setsize properties set consistent with their rendering if the cannot be determined from the DOM from a direct parsing of the host language. Places where direct parsing does not allow the user agent to determine posinset and setsize are long lists where only the currently visible items are loaded (via Ajax). If the children are resorted then the posinset and setsize values should be updated consistent with their visual rendering.

Platform accessibility API must invert this relationship for assistive technologies so that they may determine the owning parent from a child and couple it with posinset and setsize information to provide context information to the user.

4.2.2  Using owns with reuse.

If you are re-using content across different, transient sections of content by restyling it to render it in association with a different object, you need to maintain the owns property as well to match the current use and apparent ancestry of the reused sub-section. A good example of this is a context help menu that resides at the end of the document. When the user wish to launch the context help menu in association with different visual elements, styling is used to render the menu in context with that object. Prior to rendering the visual submenu you should ensure the object to which you have requested help assigns its owns property value to the submenu id. When the menu closes you can remove the owns property.

4.2.3 The controls relationship.

In Rich Internet Applications document elements may control the behavior on another part of web page outside themselves. The controls attribute indicates cause-and-effect relationships between document elements.

An example might be a group of radio buttons that "control" contents of a listbox in another part of the page. Here, you would want the radio group to assign a controls relationship to the listbox which will be updating without a page reload. The user, through their assistive technology can then navigate to the listbox by following the controls relationship, when a different radio is selected, to see how the contents changed in the listbox. The ability to update parts of a page without a page reload is a common practice of applications making use of Ajax. Without the controls attribute, a user would be unable to effectively use these types of web pages as assistive technologies often will not make the user aware of what is happening outside the context of the element the user is currently operating.

With the controls attribute the user may use the assistive technology to follow the relationship to the object it is controlling. It is extremely important for an assistive technology to present changes in the document in response to user input. Therefore, an assistive technology immediately present changes to a live region when the controlling widget is the one which has user keyboard focus. For example, if a tree view controls a help document pane, each time
the tree item changes the new tree item and then the new help contents should also be read. In the case of a screen reader, the amount of information information read in the target live region is dependent on how the live region is configured.

The controls attribute takes one or more ids which refer to the document element. If this relationship is not implied by the host language semantics, then the controlling element must be given a controls attribute with the IDs of the other elements where the changes will show up listed in the attribute value.

4.3 Changing the Reading Flow

(X)HTML suffers from a number of disadvantages in keyboard navigation today. One such example is the restriction of navigation to the tabbing order. This is a common problem with presentations in office suites where the logical, perceivable, navigation order of a slide may not match the tabbing order. Sighted users may see a logical navigation process (such as visual steps in the process for assembling a lawn mower). This "flow" is not conveyed by the tab order. The user might tab from step 1 and land on step 4. Another problem is the construction of model-based authoring tools on a web page. In a model-based authoring tool, a visual object may provide a number of paths that the user can take, such as a multiplexor, which may have output that logically flows to a number of optional electronic components in a drawing. In Web 2.0, developers are actually creating drawings like this to perform tasks such as visually model a work flow. In this scenario, the user will want to decide which object they will navigate their screen reader or alternate input device to next.

For these reasons, ARIA provides a relationship property, called flowto. This allows the author to provide an assistive technology with alternative navigation flows throughe the document that best represents the authros intent and which is more logical for people with disabilities. flowto establishes the recommended reading order of content, so that the an assistive may overriding the default of reading in document order to its user. flowto does not change the keyboard navigation order of they browser.

Consider the first case of changing a basic reading flow to circumvent(X)HTML tabbing. A good example of this is a logical reading flow in a portal with landmarks. In the future, the user may wish to change the reading flow based on the order of priority with which they navigate a personalized web application like MySpace or MyYahoo. In the following example, the navigation would follow the order of "Top News Stories", "television listings", "stock quotes", and "messages from friends" by following (X)HTML document reading order. However, the author or end user may determine that the main content is most important, followed by "stock quotes", "messages from friends", and then "TV listings."

<html>  
...
<div role="main" title="Top News Stories" id="main" aria-flowto="stock"></div>
<div role="complementary" title="television listings" id="tv"></div>
<div role="complementary" title="stock quotes" id="stock" aria-flowto="messages"></div>
<div role="complementary" title="messages from friends" id="messages" aria-flowto="tv"></div>

The second use case is such that the web developer may wish to circumvent the flow by branching to multiple paths in the web page, requiring the assistive technology to present a collection of options where the user could go next. This is important for workflows or business process management applications as shown in this Process Designer Tool. More of these applications are becoming web based, and a vehicle is required to tell the user how to get through the work flow. The flowto property takes multiple idrefs, allowing the author to define each object the user could flow to. To implement this technique do the following.

5 Document Management

5.1 Managing Content and Presentational Changes

General rules for managing content and displaying information

If you are refreshing areas asynchronously, need to look at live regions, alert, status, log.

5.2 Implementing Live Regions

Live regions are parts of a web page that the web page author expects to change. Examples of live regions include tables with dynamically updated content (sports stats, stock information), logs where new information is being added (chat transcript logs), notification areas (status, alerts), etc.

Live regions enable assistive technologies, such as screen readers, to be informed of updates without losing the users' place in the content. Live region settings provide hints to assistive technologies about how to process updates. Note that the assistive technology is responsible for handling these updates and enabling users to override these hints.

The section on Live Region Properties and how to use them enumerates the details of you to apply liver region propreties. This process will help rich Internet application (RIA) developers to set live region settings that will provide a good user experience for most assistive technology users with little configuration on their part.

  1. Identify the live regions

    Live regions are any region on a page that receives dynamic updates. Note the regions of your page that will be live.

  2. See if any of the special case live regions meet your needs

    WAI-ARIA provides a number of special case live region roles whose live region properties are pre-defined and which you may use. If one of these live region roles meet your needs just apply the specific role to the region of the web page.

  3. Decide the priority of each live region

    When a live region changes, should the user be notified of the change? Notifications could include a sound for a screen reader user. (For simplicity, we will use the case of an audio notification in this discussion.) The shorter the interval between changes and the less important the information, the less likely that the user needs hears every change. A simple example of changes that should not be heard are changes to time; a sound for every second would be very annoying.

    If the user should hear the change, should the change be announced immediately, as soon as possible, or only when the user is idle? Announcing a change immediately can be disorienting for users, so that should be done sparingly. Most updates should probably only be announced when the user is idle.

    After you have decided the priority for each live region, then decide the live property value:

    • Never spoken, then live="off"
    • Spoken when user is idle, then live="polite"
    • Spoken as soon as possible, then live="assertive"
    • Spoken immediately, then live=="rude"

  4. Decide how much context is needed for each update

    When part of a live region changes, how much context is needed to understand the change. Does the user need to hear the entire live region or just the change by itself?

    If the user needs to hear the entire live region, then mark the entire live region with atomic="true".

  5. Decide what types of changes are relevant for each live region

    Three possible types of changes are: additions, removals, and text. Additions are new nodes added to the DOM; removals are nodes removed from the DOM; and text are changes solely to the textual content. Should the user hear all types of changes or only certain types?

    By default, the user will hear additions and text type changes. If you wish to explicitly define the types of changes, you need to set relevant="THE_TYPES_OF_CHANGES". If more than one type of change is relevant, the types are separated by a space. For example, to define additions and removals as relevant but not text, set relevant="additions removals".

  6. Decide if multiple output channels make sense

    For most applications, a single output channel is sufficient. However, for complex applications with many updates happening simultaneously, multiple output channels may be advisable. You should not be concerned that a user's setup has only 1 channel, as the assistive technology will simulate 2 channels by speaking notify channel messages before main channel messages.

    If you need to use multiple channels, then you need to separate the live regions on your page and decide which ones must go into which channel. To specify a channel for a live region, you set channel="THE_CHANNEL". By default, channel="main"; you can specify a higher priority channel by using channel="notify".

5.2.1
5.2.1 Live Region Properties and how to use them

One of the most important concepts behind live regions is politeness. Politeness indicates how much priority a live region has. The following politeness settings are possible: live="off", live="polite", live="assertive", and live="rude".

live="off"
This is the default. Any updates made to this region must not be announced to the user. live="off" would be a sensible setting for things that update very frequently such as GPS coordinates of a moving vehicle.
live="polite"
Any updates made to this region should only be announced if the user is not currently doing anything. live="polite" should be used in most situations involving live regions that present new information to users, such as updating news headlines.
live="assertive"
Any updates made to this region are important enough to be announced to the user as soon as possible, but it is not necessary to immediately interrupt the user. live="assertive" must be used if there is information that a user must know about right away, for example, warning messages in a form that does validation on the fly.
live="rude"
Any updates made to this region are extremely important. In fact, the updates are so important that the user must be interrupted immediately. live="rude" should be used sparingly and only with great consideration as it can be very annoying to users.

There are times to suppress AT presentation changes while a region is updating. For that you can use the busy property.

busy="true"
To suppress presentation of changes until a region is finished updating or until a number of rapidfire changes are finished, set busy="true" and then clear the attribute when the region is finished. While it is busy, the AT will track and collate the changes. It will finally speak the changes once the region is no longer busy

When a live region is updated, the update can often be announced on its own and still make sense. For example, if a news headline is added, it would make sense to simply announce the headline. However, sometimes the entire live region must be read in order to give the user enough context to make sense of the update. For example, it would not make sense to only give the current value of a stock without saying the name of the stock. The atomic setting gives assistive technologies a hint about which of these cases an update falls into.

atomic="false"
This is the default. It means that when there is a change in the region, that change can be presented on its own; the AT should not present the entire region. atomic="false" is generally a good idea as it presents users with only changes and does not cause them to hear repetitive information that has not changed. However, web developers should take care that the changed information, when presented by itself, can still be understood and contextualized by the user.
atomic="true"
If atomic is set to "true", it means that the region must be presented as a whole; when there is a change, the AT should present the entire region, not just the change. atomic="true" can make it harder for users to understand changes as the changed areas are not presented independently. atomic="true" can also be annoying as it can force users to listen to repetitive information that has not changed. However, atomic="true" is necessary in cases where the change, when presented by itself, cannot be understood and contextualized by the user. Note that when aria-atomic="true", the AT will attempt to speak the atomic region only once when multiple changes occur in the same region and it hasn't been spoken yet.
Not all updates to a live region are relevant. For example, if the oldest headline in a list of headlines is removed and a new headline is added, the removal of the oldest headline is probably not important enough to announce to the user. However, in a chat application, when a user leaves the chat and their username is removed from the list of users, that removal may be important enough to announce. The relevant setting gives a hint about what types of changes are relevant and should be announced. Any change which is not relevant will be treated as if the region had live="off" and will not be announced. Multiple types of changes can be listed as relevant; the types are separated by a space. The default is relevant="additions text" and this is the most common use case. If the default is applicable to your application you do not need to the relevant property.
relevant="additions"
relevant="additions" states that the insertion of nodes to the live region should be considered relevant.
relevant="removals"
relevant="removals" states that the removal of nodes to the live region should be considered relevant. Often, removals are not relevant because nodes are removed to make space for new information - e.g. a log implemented as a table where items are taken off the top. However, in the case of something like a bluddylist, it is relevant if a buddy is removed. It doesn't require the screen reader to speak the removal, but it notifies the screen reader that it could be useful to do so.
relevant="text"
relevant="text" states that changes to the textual content of nodes that already exist in the live region should be considered relevant. Textual content includes text equivalents, such as the alt attribute of images.
Some notifications should be spoken before regular messages without causing the regular messages to be dropped. An example of such a notification is a chat message that is directed at the user. In such a case, that message should be spoken before the other chat messages, but the other chat messages should still be spoken and not just dropped. In addition, some AT users have both speech synthesis and Braille - they may prefer notifications to be delivered to the Braille display while regular messages are spoken by the synthesizer.channel={main/notify}gives web developers a way to provide a hint about which updates should be routed to which hardware channel, and in the case that only one channel is available, how the updates should be interleaved. The user agent defines the mapping between main/notify channels to the hardware channels available on the user's system.
channel="main"
This is the default. Messages in the main channel can only cancel out other messages in the main channel.
channel="notify"
The notify channel is slightly higher priority than the main channel. If there are two messages of equal politeness waiting in both the notify and main channels and there is only one output channel, the message in the notify channel will be processed first. However, if the politeness values are different, then the message that is less polite will be processed first, regardless of which channel it is in. Messages in the notify channel can only cancel out other messages in the notify channel.

Example 1

  1. The user is on an AT that supports only a single hardware channel.
  2. Given:
     <div id="liveRegionA" aria-live="polite" aria-channel="main">
    </div>
    <div id="liveRegionB" aria-live="polite" aria-channel="notify">
    </div>
  3. Both live regions get updates that are "polite" simultaneously. liveRegionB should be spoken first since it is on the notify channel.

Example 2

  1. The user is on an AT that supports only a single hardware channel.
  2. Given:
     <div id="liveRegionA" aria-live="assertive" aria-channel="main">
    </div>
    <div id="liveRegionB" aria-live="polite" aria-channel="notify">
    </div>
  3. Both live regions get updates simultaneously. liveRegionA should be spoken first, because its message has a higher priority than liveRegionB.

See Also Explanation of Live Region Use

5.3 Choosing between special case alert, alertdialog, status, and log live regions

You may wish to use a special live region role instead of applying live region properties. ARIA contains a number of standard roles which are by default considered "live" sections of your web page. It is important to know when to use these and when to create a custom live region on your known. Here are some rules of thumb:

alert - You must use the alert role for a one-time notification which shows for a period of time and goes away and is intended to alert the user that something has happened. The assistive technology should be notified, by the user agent, that an alert has occurred providing your operating system supports this type of event notification. When choosing to use alert you should use the alertdialog role instead if something inside the alert is to receive focus. Both alert and alertdialog appear to pop-up to the user to get their attention.

status - You must use the status role when you want to mark an area which is updated periodically and provides general status of your web application. Changes in status are not typically announced automatically by an assistive technology. However, it is possible to configure some assistive technologies, such as a scriptable screen reader, to watch for changes in the status bar and announce them. Using the status role is also important in that the user could always check the status section for changes in status on different web pages. Many applications provide status widgets and they are often found, visibly, at the bottom of the application and contain a variety of widgets within it to convey status. The use of status does not guarantee how the AT will respond to changes in the status. The author can still put live="off" or live="assertive" to influence the ATs treatment of the status.

timer - You must use a timer role when you want to mark an area which indicates an amount of elapsed time from a start point, or the time remaining until an end point. The text encapsulated within the timer indicate the current measurement, indicate the current time measurement, and are updated as that amount changes. However, unless the datatype property is used, the timer value is not necessarily machine parsable. The text contents MUST be updated at fixed intervals, except when the timer is paused or reaches an end-point.

marquee- You must use a marquee role when you need to mark an area with scrolling text such as a stock ticker. The latest text of the scrolled area must be available in the DOM. A marquee behaves like a live region, with an assumed default live property value of "polite."

log - You must use log if you have a live aria where new information is added and old information is removed, like a scrolling chat log of text. Unlike other regions, there is implied semantics to indicate the arrival of new items and the reading order. The log contains a meaningful sequence and new information is added only to the end of the log, not at arbitrary points. If the have a chat text entry area you should indicate that it also controls the aria log aria like so:

<div contenteditable="true" role="log" id="chatlog">
</div>


<label id="gettext">Send Text</label>
<div aria-controls="chatlog"
role="textbox"
contenteditable="true"
aria-readonly="false"
aria-labelledby="gettext">
</div

live region - If you have some other live area use case, ARIA allows you to mark an area using the live attribute. This accompanied by the collection of attributes which support the live property allow you to create your own custom live area on your web page. For more details regarding live regions refer to the live region section of the this guide.

6 Form Properties

Until the introduction of ARIA's invalid state and required property, only presentational strategies have been available to web content authors to indicate that certain form fields and controls are required or invalid. In applications, these states are only available through styling or varying markup, which is inconsistent, and therefore is inconclusive. In web-based forms, fields required may be marked by an asterisk. Forms submitted with required data missing or improperly specified may be redisplayed with the unacceptable elements highlighted in red. The assistive technology user is poorly served by such imprecise methods, and all users confront inconsistent indicators for consistent situations.

The ARIA invalid state and required property provide:

  1. A programmatic required property that can be applied to a form element to indicate to an AT that it is required to complete the form.
  2. A programmatic invalid state that can be used to indicate which data fields have incorrect data to an AT so that the user knows they have entered invalid data. Invalid data is often rendered in red by HTML form developers.

7 Drag-and-Drop Support

Drag-and-drop operations are a common feature of Rich Internet Applications (RIAs). Drag-and-drop features have traditionally challenged people with functional disabilities. These problems arise from the difficulty of manipulating the mouse, finding targets capable of receiving the object being dragged, and actually moving the object to the drop target. Screen readers and alternate input systems assist the user to some degree by allowing the user to simulate a click, drag, and release operation. It is then up to the user to find a target that, hopefully, will receive the object being dragged. Additionally, the user may not be aware if the desired drop operation is supported or what source objects can be selected for dragging. The end result can be a very unproductive and frustrating experience.

ARIA introduces two new Drag and Drop properties that enable web application authors to facilitate with the drag and drop process, called grab and dropeffect. The property grab is applied to the source(s) being dragged, while dropeffectis applied to the target. Use of these properties--combined with best practices for enabling the user to select the appropriate drag operation and for assigning appropriate keyboard operations for dragging and dropping--will vastly improve the accessibility of drag and drop functionality. The following steps will guide you through the process.

  1. Identify draggable objects

    Set the initial grab state of all draggable interface objects. The default state for all objects is assumed to be false, meaning that they are not draggable. For objects that may be dragged, set the grab state to "supported". Note: it is very important that objects, capable of being dragged, have a determinable role. HTML tags, such as <div> and <span>, provide no semantics unlike <select>.

    This step clearly marks elements that can be "grabbed" for drag-and-drop operation. Assistive technologies, such as screen readers or alternate input devices, can help the user move focus directly to the grab-supporting objects without having to navigate through all the elements and guess which could be ready to initiate a drag operation. Although not necessary, authors or intermediaries could use CSS to highlight those elements that may be grabbed. At this point drop targets cannot be consistently determined as targets capable of recieving a draggable object don't yet know if the object you are dragging can be recieved in a drop operation.

    All grabbable objects must be be navigable using the keyboard.

  2. Allow the user to initiate the appropriate drag operation using the keyboard

    ARIA provides three drag operation types:

    • copy: A duplicate of the source object will be dropped onto the target.
    • move: The source object will be removed from its original location and dropped onto the target.
    • reference: A reference or short cut to the dragged object will be created in the target object.

    To select a drag operation, the author must provide a keyboard accessible way of selecting one or more elements for drag. After the last object is selected for drag (if a single one object is used, it may simply be the last object with focus), the author should provide an ARIA-enabled pop-up menu from which the user can choose a supported operations from the list. A suggested way to do this is to use the Ctrl+Shift+F10 key sequence on the grab object. After the user has selected an action from the pop-up menu, the menu must close, with focus returning to the last object selected for grab. If the user does not choose an action and instead presses the Escape key (ESC), the application must dismiss the menu, returning focus to the last object selected for grab and from which the pop-up menu was launched.

    Note: In implementations where only single operations are provided, the W3C ARIA Style Guide group is considering defining hot keys to initiate the appropriate drag operation.

    All objects being grabbed must have their corresponding grab property set to "true." This will enable ATs to have a reference to the "grabbed" source object(s).

  3. Mark the drop targets

    Now that you know the drag operation, you must decide which target elements may receive the drop and mark those for the AT. You mark them by setting their dropeffect value to "copy", "move", or "reference." Like grab, drop targets must have a determinable role. CSS can also be used to highlight the targets to show sighted users which objects can receive a drop of the grabbed source(s). Any object without a dropeffect will have an assumed dropeffect value of "none." Any object with a dropeffect value of "none" is ignored by ATs in the drop operation.

  4. Configure your script for AT drag-and-drop operations

    You must now configure your script to handle mouse movements as if the user had depressed the mouse key and begun a drag. The AT will move the mouse to accepting drop targets based on its own keyboard navigation scheme defined for a drag. Drag operations usually show the source object(S) being moved, such as through the use of a bitmap representation drawn to follow the mouse cursor position, as the user moves the mouse while keeping the mouse button depressed. You need to perform the same operation with the exception that you ignore the mouse key's pressed state. AT will either move the mouse cursor automatically in response to their designated keyboard commands or through user tabbing to targeted elements. At some point, the user will have the mouse cursor over the desired drop target. You must assume that the user's pressing the Enter key will cause the selected drop operation to occur on the drop target. This completes the drop operation.

  5. If at any time during the drag process, the user pressed the Escape key to cancel drag operations, all dropeffect properties must be set to "none", keyboard focus should return to the last grabbed source object, and all grabbable objects grab properties must be set to "supported."

  6. Clean-up after drag/drop

    Once the drop has occurred, you should clean up the DOM as you would do for any drag/drop operation. You must then set focus to the appropriate DOM element and its role must also be determinable.

  7. Other considerations

    Should the author wish to let the user decide which drop operation is chosen at the target, the author may use a single key sequence at the source to activate a grab and then set the drop effects that are possible on the accepting targets:

    Example:

    <div role="treeitem" aria-dropeffect="copy move"> 

    This allows the AT to surface to the user the drop effects that are available. Once the user navigates to the target, execute the drop. The author must provide the ability for the user to launch an ARIA-enabled pop-up menu to select the appropriate drop operation which is determined upon user selection. At this point, the author must perform the appropriate clean-up operations discussed in Step 5.

8 Implementation Guidance

Todo: pull in new content from http://dev.aol.com/dhtml_style_guide (automate if possible)

For these widgets and structures, this document describes the keyboard and mouse interaction, styling considerations, ARIA roles and properties.

8.1 Common Widget design patterns

This section contains common design patterns for widgets in rich web applications are individual entities or controls.

Widget: Button

Characteristics:
Description: button widgets allow for user-triggered actions, and they are most often used for discrete, atomic actions. Buttons support the optional state pressed. Buttons with this state present are toggle buttons. When pressed is "true" the button is depressed, when pressed is "false" it is not depressed.
Keyboard Interaction:

With focus on the button, pressing Spacebar or Enter keys executes the action for that button.

  • If the button activation closes the containing entity or launches another entity, then focus moves to the newly opened entity.
  • If the button activation does not close or dismiss the containing entity, then focus remains on the button. An example might be an Apply or Recalculate button.
Mouse Interaction:
  • Clicking on the button executes the action for the button.
  • If focus is on another element when a button is clicked with a mouse, the focus moves to the clicked button.
  • If focus is on another element and the mouse is moved over a button, a visual indicator is provided to show that the button may be clicked, but focus does not yet move.
  • If focus is on another element and the mouse is moved over a button then moved away, the visual indicator goes away and focus is unchanged.
Styling:

When the button is in a pressed state -- either briefly when Enter or Spacebar are pressed or when the primary mouse button has been pressed but not released, then the visual appearance is altered to differentiate the pressed from an unpressed state.

ARIA Roles, States, and Properties:
  • The button receives a role of button.
  • The button description receives a role of role="description" and the describedby property.
  • When the action associated with a button is unavailable, the button displays in a disabled state.
Example:

XHTML button


Widget: Menu

Characteristics:
Description:

A menu is a control offering the user a list of choices. A menu is often a list of links to important sections of a document or a site. Menus contain menuitems, and they are typically collected on a menubar.

Keyboard Interaction:
  • First item in menu bar should be in the tab order (tabindex=0).
  • If a menu bar item has focus, then:
    • Pressing Enter, Spacebar, or the up or down arrow keys opens the menu and places focus on the first menu item in the opened menu or child menu bar.
    • If no menu is open, pressing left or right arrow keys moves focus to the adjacent menu bar items.
  • When a menu is open and focus is on a menu item in that open menu, then
    • Pressing Enter or Spacebar invokes that menu action (which may be to open a submenu).
    • Pressing up or down arrow keys cycles focus through the items in that menu.
    • If the menu item with focus has a submenu, pressing Enter, Spacebar, or the right arrow key opens the submenu and puts focus on the first submenu item.
    • Pressing Escape closes the open menu or submenu and returns focus to the parent menu item.
  • When a submenu is open and focus is on a menu item in that submenu:
    • The up or down arrow keys cycle through the submenu items (behaves the same as open menu).
    • Pressing Escape or the left arrow key closes the submenu and returns focus to the parent menu item.
  • Disabled menu items receive focus but have no action when enter or left/right arrow is pressed.
  • Tabbing out of the menu component closes any open menus.
  • With focus on a menu item and a sub menu opened via mouse behavior, pressing down arrow moves focus to the first item in the sub menu.
  • With focus on a menu item and a sub menu opened via mouse behavior, pressing up arrow moves focus to the last item in the sub menu.
  • With focus on a submenu item, the user must use arrows or the Escape key to progressively close submenus and move up to the parent item(s).
Mouse Interaction:
  • Primary mouse click on a closed menu opens the menu; a second mouse click on the menu item closes the menu.
  • Primary mouse click on a menu item invokes that menu action (which may be to open a submenu).
  • A primary mouse click away from an open menu closes the menu.
Styling:  
ARIA Roles, States, and Properties:
Example:

XHTML Spreadsheet


Widget: Menu Button

Characteristics:
Description:

This might also be called a drop-down button. Pressing the button causes a drop-down menu to display. The user can then select an item from the menu. {Removed until image copied to spec location}This image from the Dojo JavaScript Toolkit is an example. The button itself is labeled "Edit". When the button is pressed a drop-down menu appears with three choices: cut, copy, paste.

Keyboard Interaction:
  • With focus on the button pressing space or enter will toggle the display of the drop-down menu. Focus remains on the button.
  • With focus on the button and no drop down menu displayed, pressing down arrow will open the drop-down menu and move focus into the menu and onto the first menu item.
  • With focus on the button and the drop-down menu open, pressing down arrow will move focus into the menu onto the first menu item.
  • With focus on the drop-down menu, the up and down arrow keys move focus within the menu items, "wrapping" at the top and bottom.
  • With focus on the drop-down menu, pressing escape closes the menu and returns focus to the button.
  • With focus on the button pressing the tab key will take the user to the next tab focusable item on the page.
  • With focus on the drop-down menu, pressing the tab key will take the user to the next tab focusable item on the page. Note that this may be difficult to achieve on a web page.
Mouse Interaction:
  • Clicking on the button toggles opening/closing the associated menu. Focus is set on the button.
  • Clicking on a item in the opened drop-down menu executes the action for that menu item and closes the menu. Focus returns to the button.
  • Mouse out of an opened menu closes the menu and returns focus to the button.
  • Mouse over of an opened menu changes the visual indicator to indicate that it is the current choice. Should mouse over actually set focus? At a minimum the button object needs to know what the current menu item is so the mouse and keyboard can interact.
Styling:  
ARIA Roles, States, and Properties:

Option 1:

  • The button receives a role of button with an owns property, if necessary.
  • The drop-down menu has a role of menu. May have a hasparent property depending upon whether or not implementation creates children within the hierarchy of the parent button or not.
  • Each menu item has a role of menuitem. May have a hasparent property depending upon whether or not implementation creates children within the hierarchy of the parent menu.

Option 2:

  • The button receives a role of menu with an owns property depending upon whether or not the drop-down menu is created as a direct child element of the button in the DOM hierarchy.
Example:

XHTML Spreadsheet


Widget: Combo Button

Characteristics:
Description:

The Combo Box control has a static text field label explicitly associated with the control. Optionally the label has a mnemonic to aide navigation.

Keyboard Interaction:  
  • Tab moves focus to the drop-down button.
  • Left arrow moves focus from the button into the text field.
  • Enter posts the list. When menu is posted, up arrow and down arrow keys move highlight and selection up or down within the list.
  • Enter or spacebar closes the list, maintaining latest selection (highlighted item).
  • Escape dismisses the list and reverts to the prior selection.
Mouse Interaction:
  • RMB click in text area moves focus into text area and displays insertion cursor.
  • RMB click on down-arrow button toggles post / unposting of the list.
  • RMB on list item selects the item.
  • RMB away from control also unposts list.
 
Styling:  
ARIA Roles, States, and Properties:   A combo box uses the WAI-ARIA roles:
  • combobox for box itself
  • textbox for the editable portion of the box
  • listitem for the items displayed in the combo box when it is opened

Combo boxes use the ARIA properties disabled, readonly, and expanded.

Example:  

Checkbox

Characteristics:
Description:

A checkbox is an input option that represents a setting or value with an on, off, or mixed choice. A check mark within the checkbox indicates that the setting is selected or checked.

Checkboxes in a group are non-exclusive options; more than one checkbox in a group can be checked at any given time.

Keyboard Interaction:

When focus is on a checkbox, the Spacebar key toggles the selection, checking or unchecking the box.

Mouse Interaction:

Clicking on a checkbox with the primary mouse button toggles its selection.

Styling:
  • Checkboxes are typically represented as squares with a check mark inside when checked.
  • If the checkbox is in an undetermined state, its appearance will resemble a disabled state.
ARIA Roles, States, and Properties:
Example:

Checkbox with title for accessible name


Widget: Radio Button

Characteristics:
Description:

A radio button is one of a group of controls representing mutually-exclusive choices. A radio button is typically represented as a round control to distinguish from the square checkbox control. It supports the events:

Set selection
Fills in circular control of radio button with current focus, clearing any prior selection in the group. May be referred to as checked.
Clear selection
Indirect. Occurs when selection is explicitly set in other radio button in group.
Keyboard Interaction:
  • Focus can move to a radio group via:
    • The Tab key
    • An Access Key or mnemonic targeting the label
    • Activation of the label (through Assistive Technology mechanism)
  • The Tab key moves focus between radio button groups and other widgets.
  • When focus is on the group and when no radio button is selected:
    • Tab key press moves focus to the first radio button in the group, but does not select the radio button.
    • Shift+Tab key press moves focus to the last radio button in the group, but does not select the radio button.
  • When focus moves to the group in which a radio button is selected, pressing Tab and Shift+Tab keys move focus to the radio button that is checked.
  • Up Arrow and Down Arrow keys move focus and selection.
    • Up Arrow key press moves focus and selection forward through the radio buttons in the group. If the first radio button has focus, then focus and selection move to the last radio button in the group.
    • Down Arrow key press moves focus and selection backward through the radio buttons in the group. If the last radio button has focus, then focus and selection move to the first radio button in the group. * Space Bar key press checks the radio button that currently has focus.
  • When re-entering the group, focus returns to the point of previous focus (the item with selection set).
  • Pressing the Tab key exits the group and moves focus to the next form control.
  • Pressing the Shift+Tab keys exits the group and moves focus to the previous form control.
Mouse Interaction:

A primary mouse button click on an unselected item selects that radio button and clears any other selected radio button in the group.

Styling:  
ARIA Roles, States, and Properties:

The radio button control uses the role radio. The group of radio controls uses the role radiogroup.

It uses the state checked and the properties labelledby and activedescendant.

Example:

Sample radio buttons.

Please note that not all examples work in all browser and version combinations. For example, note the compatibility statement.

8.2 Common structural widgte design patterns

Structures are objects that contain and organize widgets.

Widget: Tab Panel


Characteristics:
Description:

A tabbed interface component is a container for resources associated with a tab. It is a set of layered pages where only one page is displayed at a time. The general look is similar to a file folder with a "tab" that contains the title of the folder. The tabs are arranged along one of the edges of the contents but most commonly are found at the top of the page. The user navigates and makes the contents of each page visible by interacting with the title "tab" of the page. Sometimes referred to as a tab container or tab panel. Terms for understanding Tab Panels include:

tabbed interface component
a set of tabs and associated tab panels
tab panel
contents area that is associated with a tab
tab
the label/title area of the tab panel. This is where you click to activate a tab panel
tablist
the set of tabs

When the user activates a tab, the contents of that tab is made visible. The tab is considered "active". The tab remains active until another tab is activated. The active tab is placed into the tab order. Only the active tab should be in the tab order. A default tab is specified that is active when the tabbed interface component is initialized. A collection of tabs and their associated tab panels is a complex widget, because it performs show/hide actions as well as moving the user's point of regard around within the content.

Keyboard Interaction:
  • Tab - only the active tab is in the tab order. The user reaches the tabbed panel component by pressing the tab key until the active tab title receives focus.
  • left arrow - with focus on a tab, pressing the left arrow will move focus to the previous tab in the tab list and activate that tab. Pressing the left arrow when the focus is on the first tab in the tab list will move focus and activate the last tab in the list.
  • Right arrow - with focus on a tab, pressing the right arrow will move focus to the next tab in the tab list and activate that tab. Pressing the right arrow when the focus is on the last tab in the tab list will move focus to and activate the first tab in the list.
  • Up arrow - behaves the same as left arrow in order to support vertical tabs
  • Down arrow - behaves the same as right arrow in order to support vertical tabs
  • Ctrl-Up arrow - with focus anywhere within the tab panel, pressing ctrl-up arrow will move focus to the tab for that panel. This is not standard behavior - is this something we want to implement? Is it necessary if we provide a mechanism to change the active tab? Similar to ctrl-pageup/pagedown in Firefox to switch tabs?
  • Alt-Del - When deletion is allowed, with focus anywhere within the tab panel, pressing alt-del will delete the current tab and tab panel from the tabbed interface control. If additional tabs remain in the tabbed interface, focus goes to the next tab in the tab list. An alternative to providing a keystroke to close a tab is to provide a context menu that is associated with the tab title. When focus is on the tab, pressing shift-F10 or pressing the right mouse button will open a context menu with the close choice
  • Ctrl-PageUp - When focus is inside of a tab panel, pressing ctrl-pageup moves focus to the tab of the previous tab in the tab list and activates that tab. When focus is in the first tab panel in the tab list, pressing ctrl-pageup will move focus to the last tab in the tab list and activate that tab.
  • Ctrl-PageDown - When focus is inside of a tab panel, pressing ctrl-pagedown moves focus to the tab of the next tab in the tab list and activates that tab. When focus is in the last tab panel in the tab list, pressing ctrl-pageup will move focus to the first tab in the tab list and activate that tab.

Regarding Ctrl-PageUp/PageDown. This is currently implemented in Firefox to move between browser tabs. Firefox also supports ctrl-tab and ctrl-shift-tab to move between tabs. Internet Explorer 7 also uses Ctrl-Tab and Ctrl-Shift-Tab. There may be advantages to using Ctrl-PageUp/PageDown as the keys to change tabs since it is a recognizable keystroke to at least Firefox users and is also supported by the Windows operating system to move between panels in a tabbed dialog. The problem is that if the user is within a tabbed interface control on a Web page, they can not easily switch browser tabs without first moving focus outside of the tabbed interface control. This may be acceptable. The other issue is if the entire Web page is a tabbed interface control - in that case the user could not ever switch browser tabs unless the control on the Web page ignored the ctlr-pageup/pagedown keypress (and thus letting the browser access it) when the first or last tab was reached.

Mouse Interaction: Clicking on the tab title activates the tab and sets focus to the tab title.
Styling:
  • The active tab is visually differentiated from the other tabs. This style should be visible in high contrast mode.
  • Focus on the tab is usually indicated as focus on the title text/element of the tab. Setting focus to the tab activates that tab.
ARIA Roles, States, and Properties:
  • The tabbed interface component uses the role tabpanel.
  • The tabbed panel contains tabs and their panels. An element with role tab is used as a grouping label, providing a link for selecting the tabcontent to be rendered to the user.
  • The currently selected tab has the state selected=true.
  • A tablist is the container role for a set of elements with the role attribute set to tab.
Example:  

Unresolved at time of port from DHTML wiki: How to indicate that a tab panel can be deleted? Visually a close icon can be provided in the upper right hand corner of the tab which the user can click on to delete the tab panel. Putting this close icon in the navigation sequence would make extra navigation. Is there some way to indicate to a non-visual user that a tab panel can be deleted with a defined keystroke? Perhaps we can capture ctrl-w (the key used in Firefox and IE 7) to close a tab? T * here is still the issue of the user knowing that the tab is closable or not. Another option is to provide a context menu. With focus on the tab title the user would press shift-F10 to invoke a context menu - the context menu would have the close option. In both of these cases if the tab can not be closed, it still needs to capture the keystroke so that it doesn't get bubbled up and handled by the browser. Retrieved from "http://www.weba11y.com/styleguide/index.php?title=Tab_Panel"

Widget: Tree View

Characteristics:
Description:

A tree view is a component to navigate hierarchical lists. It is made up of one or more top level nodes. A node may have children or it may be an end node. Nodes with children can be expanded or collapsed - when expanded its child nodes are visible. When collapsed the children are not visible. There is generally some sort of visual indication whether a node has children and can be expanded. Any number of nodes can be expanded at a time and child nodes may contain children.

A tree node is commonly used to navigate the directories and files on a file system. The directory nodes can be expanded and collapsed to reveal its contained subdirectories and files. Terms for understanding tree views include:

node
An item in a tree.
parent node
Node with children. It can be opened / expanded or closed / collapsed
open node
Expanded node with children; first-level children are visible.
closed node
Closed node with children; the children are not visible.
end node
Node with no children

General behavior for tree views follows:

  • On first load of the tree component, the top level node is in the tab order.
  • One and only one node of the tree component is in the tab order of the page at any time.
  • The last visited node in the tree control is retained in the tab order when the user navigates away from the tree control.
  • Nodes can be focused and/or selected. There must be visual distinction between focused and selected nodes.
  • Arrowing to an item with the keyboard or clicking on an item with the mouse will focus and select the node. Any previous selections are cleared
Keyboard Interaction:
  • Up and down arrow keys move between visible nodes
  • Left arrow key on an expanded node closes the node
  • Left arrow key on a closed or end node moves focus to the node's parent
  • Right arrow key expands a closed node, moves to the first child of an open node, or does nothing on an end node.
  • Enter key causes on-double-click action on end nodes. Open issue: are there ever parent nodes that have an action other than expand or collapse?
  • Typing a letter key moves focus to the next instance of a visible node whose title begins with that letter.
  • Home key moves to the top node in the tree view
  • End key moves to the last visible node in the tree view
  • Ctrl-Arrow to an item with the keyboard focuses the item (but does not select it). Previous selections are maintained.
  • Ctrl-Arrow-Space - Selects non-contiguous nodes
  • Ctrl-Spacebar with focus on an item toggles the selection of the item
  • Shift-UpArrow - Extends selection up one node
  • Shift-DownArrow - Extends selection down one node
  • Shift-Home - Extends selection up to the top-most node
  • Shift-PageDown - Extends selection down to the last node
  • *(asterisk) on keypad - Expands all nodes
Mouse Interaction:
  • Click on a node sets focus and selects the node
  • Ctrl-click on a node focuses and selects the node. Previous selections are maintained.
  • Double click on an end node causes any associated action to be invoked. Open issue: are there ever parent nodes that have an action other than expand or collapse?
  • Click on a closed node opens the node.
  • Click on expand / collapse icon associated with a parent node toggles the expand/collapse of the node

Note: The user should be able to switch between using the mouse and using the keyboard to interact with the tree component.

Styling:

Parent nodes generally have some visual icon to indicate the ability to expand or collapse the node. The convention is that a plus (+) icon is displayed when the parent node is collapsed, the user clicks on this icon to expand the node. A minus icon is displayed when the parent node is expanded, the user clicks on this icon to collapse the node. The expand and collapse behavior can also be invoked via the right and left arrow keys when focus is on the node as described in the Keyboard Behavior section above.

A selected node should be indicated via a visual styling such as color difference and/or a distinct border.

The browser will generally provide visual identification of focused nodes.

ARIA Roles, States, and Properties: A tree view uses the ARIA role tree, where tree is a main container element. A tree can itself contain subtrees that may be collapsed and expanded; these have the role treeitem. A collection of treeitems to be expanded and collapsed are enclosed in a group. See the XHTML example in the WAI-ARIA [WAI-ARIA] specification.
Example:  

Widget: Multi-Column Tree Grid

Characteristics:
Description:

Content pending from DHTML Task force.

Keyboard Interaction:  
Mouse Interaction:
Styling:
ARIA Roles, States, and Properties:
Example:

This example contains a Grid with an expandable, all column-spanning row forming having a sub row below as its content. ARIA roles and states have been applied to all grid cells.

Commented out reference to examples:

9 Reusable Component Libraries

Writing Rich Internet Applications is much more difficult than righting in HTML. It is even more work to ensure your application runs in multiple browsers and support WAI-ARIA. It is highly recommended that you reuse existing rich internet application widget libraries which have implemented WAI-ARIA. The authors of these libraries will have to have gone through:

It is recommended that authors start by using a UI component library which has already implemented WAI-ARIA like the Dojo Toolkit Dijit library.

10 Testing

This page contains links to resources containing test files, sample widgets, etc. Please add other known resources here. The plan is to expand this to index all known test cases, categorized.

10.1 Test case details

The following table details test cases.

Columns:

TEST CASE DETAILS

Concept

ARIA Features

Description

Reference

Widget

Widget

{Description}

Link

checkbox

Uses role="checkbox" and checked state

Accessible checkbox created without the input element.

XHTML version HTML version

slider

Uses role="slider" and ARIA states: valuenow, valuemax, valuemin

Accessible slider widget

Graphical XHTML slider Basic XHTML slider

progress bar

Uses role="progressbar" and ARIA states: valuenow, valuemax, valuemin

This is an accessible XHTML progress bar

XHTML progress bar

alert

Uses role="alert"

This is an accessible alert created using a div. The visibility style is changed from "hidden" to "visible" to hide and show it.

XHTML alert HTML alert

tree

Uses role="tree", role="treeitem", role="group" to group subtrees, expanded state

This is an example of a tree widget role. Each item in the tree has a role of "treeitem" and subtrees are grouped using the "group" role. The expanded state is set on tree items to indicate if its subtree is expanded. This example relies on the static DOM structure to allow the user agent to convey "level" semantics to the assistive technology.

XHTML tree HTML tree

tree controlling a region

role="complementary" and controls property

Uses a tree widget that uses Ajax to acquire a picture and render it in a region. The widget, having a role of tree, controls the "complementary" region. Select assistive technologies should allow the user to follow the controls property.

Simple HTML Ajax example of a tree widget controlling a region

button and description

role="button" role="description" and the describedby property

Provides an accessible pushbutton without using an input element. This examples sets up two description areas and uses describedby to associate the button and the fieldset with the description areas. Pushing the button uses javascript to launch an alert

XHTML button

grid, gridcell, and columheader

roles: grid, gridcell, columnheader; ARIA properties: readonly, selected, tabindex

Provides an accessible spreadsheet, using the grid role, which you can tab to the grid. Arrow keys are then used to navigate the gridcells within the grid.

XHTML spreadsheet

menu, menubar, menuitem

roles: menubar, menu, menuitem, ARIA properties: tabindex

Provides an accessible horizontal menu and uses the DOM hierarchy to provide the menu structure to the assistive technology. This example uses tabindex to manage focus within the menu.

XHTML menu

10.2 Test Result Matrix

The following definition list details test cases.

Todo: Test results are supposed to link somewhere, but link location not provided

Concept: checkbox
ARIA Features: Uses role="checkbox" and checked state
Description: Accessible checkbox created without the input element.
Reference 1: XHTML checkbox example
Reference 2: HTML checkbox example
Test Results:
  • Reference 1 tested with JAWS 8.00.2173/Minefield Build 3.0a9pre [2007-10-23 build]
  • Reference 2 tested with JAWS 8.00.2173/Minefield Build 3.0a9pre [2007-10-23 build]
 
Concept: slider
ARIA Features: Uses role="slider" and ARIA states: valuenow, valuemax, valuemin
Description: Accessible slider widget
Reference 3: Graphical XHTML slider
Reference 4: Basic XHTML slider
Test Results:
  • Reference 3 tested with JAWS 8.00.2173/Minefield Build 3.0a9pre [2007-10-23 build]
  • Reference 4 tested with JAWS 8.00.2173/Minefield Build 3.0a9pre [2007-10-23 build]
 
Concept: progressbar
ARIA Features: Uses role="progressbar" and ARIA states: valuenow, valuemax, valuemin
Description: This is an accessible XHTML progress bar
Reference 5: XHTML progress bar
Test Results:
  • Reference 5 tested with JAWS 8.00.2173/Minefield Build 3.0a9pre [2007-10-23 build]
 
Concept: alert
ARIA Features: Uses role="alert"
Description: This is an accessible alert created using a div. The visibility style is changed from "hidden" to "visible" to hide and show it.
Reference 6: XHTML alert
Reference 7: HTML alert
Test Results:
  • Reference 6 tested with JAWS 8.00.2173/Minefield Build 3.0a9pre [2007-10-23 build]
  • Reference 7 tested with JAWS 8.00.2173/Minefield Build 3.0a9pre [2007-10-23 build]
Concept: tree
ARIA Features: Uses role="tree", role="treeitem", role="group" to group subtrees, expanded state
Description: This is an example of a tree widget role. Each item in the tree has a role of "treeitem" and subtrees are grouped using the "group" role. The expanded state is set on tree items to indicate if its subtree is expanded. This example relies on the static DOM structure to allow the user agent to convey "level" semantics to the assistive technology.
Reference 8: XHTML tree
Reference 9: HTML tree
Test Results:
  • Reference 8 tested with JAWS 8.00.2173/Minefield Build 3.0a9pre [2007-10-23 build]
  • Reference 9 tested with JAWS 8.00.2173/Minefield Build 3.0a9pre [2007-10-23 build]
 
Concept: tree controlling a region
ARIA Features: role="complementary" and controls property
Description: Uses a tree widget that uses Ajax to acquire a picture and render it in a region. The widget, having a role of tree, controls the "complementary" region. Select assistive technologies should allow the user to follow the controls property.
Reference 10: Simple HTML Ajax example of a tree widget controlling a region
Test Results:
  • Reference 10 tested with JAWS 8.00.2173/Minefield Build 3.0a9pre [2007-10-23 build]
 
Concept: button and description
ARIA Features: role="button" role="description" and the describedby property
Description: Provides an accessible pushbutton without using an input element. This examples sets up two description areas and uses describedby to associate the button and the fieldset with the description areas. Pushing the button uses javascript to launch an alert
Reference 11: XHTML button example
Test Results:
  • Reference 11 tested with JAWS 8.00.2173/Minefield Build 3.0a9pre [2007-10-23 build]
 
Concept: grid, gridcell, and columnheader
ARIA Features: roles: grid, gridcell, columnheader; ARIA properties: readonly, selected, tabindex
Description: Provides an accessible spreadsheet, using the grid role, which you can tab to the grid. Arrow keys are then used to navigate the gridcells within the grid.
Reference 12: XHTML spreadsheet example
Test Results:
  • Reference 12 tested with JAWS 8.00.2173/Minefield Build 3.0a9pre [2007-10-23 build]
 
ARIA Features: roles: menubar, menu, menuitem, ARIA properties: tabindex
Description: Provides an accessible horizontal menu and uses the DOM hierarchy to provide the menu structure to the assistive technology. This example uses tabindex to manage focus within the menu.
Reference 13: XHTML menu
Test Results:
  • Reference 13 tested with JAWS 8.00.2173/Minefield Build 3.0a9pre [2007-10-23 build]
  • Reference 13 tested with NVDA ( build)/Minefield Build 3.0a9pre [2007-10-23 build]
  • Reference 13 tested with Orca *.*/Minefield Build 3.0a9pre [2007-10-23 build]
  • Reference 13 tested with Window-Eyes *.*/Minefield Build 3.0a9pre [2007-10-23 build]
  • Reference 13 tested with FireVox ()/Firefox 2.* [build ]
  • Reference 13 tested with ZoomText (*.*)/Minefield Build 3.0a9pre [2007-10-23 build]

This is a placeholder anchor for the references to be added.

11 Appendices

11.1 Roles, States, and Properties Mapped to Accessibility APIs

Todo: Moved from States & Properties. Under development at http://esw.w3.org/topic/PF/aria/BestPractices/API.

This section is informative.

Mapped properties (Please note: This is a common subset of all mapping options)

ARIA MSAA IAccessible2 ATK
disabled MSAA:STATE_SYSTEM_UNAVAILABLE   ATK:ATK_STATE_DISABLED
checked MSAA: STATE_SYSTEM_CHECKED   ATK: ATK_STATE_CHECKED
expanded If the hidden property is set to true : MSAA:STATE_SYSTEM_COLLAPSED

If the hidden property is set to false: MSAA:STATE_SYSTEM_EXPANDED

  If the hidden property is set to true : ATK: ATK_STATE_EXPANDABLE

If the hidden property is set to false: ATK:ATK_STATE_EXPANDED

haspopup This state should be mapped to true on Windows systems when an event handler has a role of pop-up menu.

MSAA: haspopup

  ATK: not necessary in ATK because it has multiple actions with description
invalid MSAA: no mapping

In the case of MSAA the user agent should provide a specialized API to return its value. Alternatively, if the user agent provides a specialized API for XForms [XForms] it may provide invalid(), outOfRange(), or empty() (returns true when required but not available). This information is computed from the instance data associated with the form element.

IA2_STATE_INVALID ATK:ATK_STATE_INVALID
multiselectable MSAA:STATE_SYSTEM_EXTSELECTABLE   ATK:ATK_STATE_MULTISELECTABLE
pressed MSAA: STATE_SYSTEM_PRESSED is true when checked.   ATK: ATK_STATE_PRESSED is true when checked
readonly MSAA:STATE_SYSTEM_READONLY   ATK:ATK_STATE_READONLY=inverse of readonly
required MSAA: There is no mapping.

User agent must make available through the DOM [DOM] or a specialized API.

Note: While optional could be combined with required this is kept to be consistent with CSS3 pseudo classes and XForms [XForms].

  ATK: There is no mapping.
selected MSAA:STATE_SYSTEM_SELECTED   ATK:ATK_STATE_SELECTED
unknown MSAA:mixed   ATK:indeterminate
value MSAA: should return the value for getValue().   ATK: should return this as part of the AccessibleValue structure.

(As yet) unmapped properties are:

Todo: describedby is a describedby, labelledby, flowto, controls have IAccessible2 mappings
valuemax, valuemin, currentvalue are mapped to AccessibleValue in IAccessible2 http://accessibility.freestandards.org/a11yspecs/ia2/docs/html/

Todo: Here is Aarons ARIA mapping document. : http://developer.mozilla.org/en/docs/ARIA_to_API_mapping

There are some gaps. .... marquee and tooltip are not there.

11.2 ToDo List

This page holds information about issues that we've determined need clarification, but a home for the clarification has not yet been determined.

11.3 User Agent Implementation Considerations

Todo: Aaron to fill out

11.3.1 Managing Showing and Hiding document sections

11.3.2 Notification of changes to sections

11.3.3 ARIA to Accessibility API Events

11.3.4 Role Mappings

11.3.5 Mapping to platform accessibility APIs

User agents should map ARIA role and property semantics to the closest appropriate matches in their supported accessibility API. When it is not possible to find an exact match for a given role or property, API extensions should be utilized to expose the complete information.

11.4 References

This section is informative.

[ARIA]
Accessible Rich Internet Applications (WAI-ARIA) Version 1.0. L. Seeman, M. Cooper, R. Schwerdtfeger, L. Pappas, Editors, W3C Working Draft (work in progress), 4 February 2008. This version of WAI-ARIA is available at http://www.w3.org/TR/2008/WD-wai-aria-20080204/. Latest version of WAI-ARIA available at http://www.w3.org/TR/wai-aria/.
[ARIA-PRIMER]
WAI-ARIA Primer. L. Pappas, R. Schwerdtfeger, M. Cooper, Editors, W3C Working Draft (work in progress), 4 February 2008. This version of WAI-ARIA Primer is available at http://www.w3.org/TR/2008/WD-wai-aria-primer-20080204/. Latest version of WAI-ARIA Primer available at http://www.w3.org/TR/wai-aria-primer/.
[ARIA-ROADMAP]
Roadmap for Accessible Rich Internet Applications (WAI-ARIA Roadmap), R. Schwerdtfeger, Editor, W3C Working Draft (work in progress), 4 February 2008. This version of WAI-ARIA Roadmap is available at http://www.w3.org/TR/2008/WD-wai-aria-roadmap-20080204/. Latest version of WAI-ARIA Roadmap available at http://www.w3.org/TR/wai-aria-roadmap/.
[DOM]
Document Object Model (DOM) Level 2 Core Specification, L. Wood, G. Nicol, A. Le Hors, J. Robie, S. Byrne, P. Le Hégaret, M. Champion, Editors, W3C Recommendation, 13 November 2000, http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/. Latest version of DOM Core available at http://www.w3.org/TR/DOM-Level-2-Core/.
[XFORMS]
XForms 1.0 (Third Edition), J. Boyer, Editor, W3C Recommendation, 29 October 2007, http://www.w3.org/TR/2007/REC-xforms-20071029/. Latest version of XForms available at http://www.w3.org/TR/xforms/.

11.5 Acknowledgments

This section is informative.

The following contributed to the development of this document.

11.5.1 Participants active in the PFWG at the time of publication

  • Chris Blouch (AOL)
  • Charles Chen (Google)
  • Michael Cooper (W3C/MIT)
  • Dimitar Denev (FIT)
  • Donald Evans (AOL)
  • Kentarou Fukuda (IBM)
  • Alfred S. Gilman (W3C Invited Expert)
  • Jon Gunderson (UIUC)
  • Kenny Johar (Vision Australia)
  • Diego La Monica (IWA/HWG)
  • Aaron Leventhal (IBM)
  • Thomas Logan (Invited Expert, BayFirst Solutions)
  • Matt May (Adobe)
  • Charles McCathieNevile (Opera)
  • Lisa Pappas (Invited Expert, SAS)
  • Dave Pawson (RNIB)
  • David Poehlman (Invited Expert, State of MD)
  • Gregory Rosmaita (Invited Expert)
  • Janina Sajka (Invited Expert, The Linux Foundation)
  • Stefan Schnabel (SAP)
  • Richard Schwerdtfeger (IBM)
  • Lisa Seeman (UB Access)
  • Marc Silbey (Microsoft)
  • Mike Squillace (IBM)
  • Gottfried Zimmermann (Access Technologies Group)

11.5.2 Other previously active PFWG participants and other contributors to the Accessible Rich Internet Applications specification

Special thanks to Aaron Leventhal for effort and insight as he implemented a working prototype of accessibility API bindings.

Jim Allan (TSBVI), Simon Bates, Judy Brewer (W3C/MIT), Christian Cohrs, Becky Gibson (IBM), Andres Gonzalez (Adobe), Georgios Grigoriadis (SAP AG), Jeff Grimes (Oracle), Barbara Hartel, Sean Hayes (Microsoft), John Hrvatin (Microsoft), Earl Johnson (Sun), Masahiko Kaneko (Microsoft), Jael Kurz, Alex Li (SAP AG), William Loughborough, Linda Mao (Microsoft), Anders Markussen (Opera), Dave Pawson (RNIB), T.V. Raman (Google), Vitaly Sourikov, Ryan Williams (Oracle), Tom Wlodkowski.

11.5.3 Enabling funders

This publication has been funded in part with Federal funds from the U.S. Department of Education under contract number ED05CO0039. The content of this publication does not necessarily reflect the views or policies of the U.S. Department of Education, nor does mention of trade names, commercial products, or organizations imply endorsement by the U.S. Government.