ARIA Proposal

Work in Progress — Last Update 26 September 2007

Editor
Simon Pieters, Opera Software, simonp@opera.com
Contributor
Aaron Leventhal, IBM, aleventh@us.ibm.com

Abstract

...

This spec assumes that HTML elements are in the http://www.w3.org/1999/xhtml namespace, as required by HTML5.

What authors are allowed to do should probably be constrained, and UAs should perhaps ignore some roles or states in certain cases.

The role attributes

Authors may specify a role attribute in no namespace on any element in the http://www.w3.org/1999/xhtml namespace.

Authors may specify a role attribute in the http://www.w3.org/1999/xhtml namespace on any element that is not in the http://www.w3.org/1999/xhtml or http://www.w3.org/2002/06/xhtml2/ namespace.

The value of these attributes must be an unordered set of space-separated tokens where each token must be a valid role identifier.

What "unordered set of space-separated tokens" means is defined in HTML5.

A valid role identifier is one of the following:

Thus the roles defined in the XHTML Role Attribute Module are effectively moved to the http://www.w3.org/2005/01/wai-rdf/GUIRoleTaxonomy# namespace.

The wairole prefix is thus fixed to the http://www.w3.org/2005/01/wai-rdf/GUIRoleTaxonomy# namespace, just like the xml prefix is fixed to the http://www.w3.org/XML/1998/namespace namespace in XML. However, unlike the xml prefix, the wairole prefix has to be declared before it is used according to this specification.

Since HTML doesn't do namespaces, the only allowed way to express roles declaratively in HTML is by using the unprefixed syntax, as in the following example:

<div role="checkbox"></div>

In XHTML, the following is allowed:

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:wairole="http://www.w3.org/2005/01/wai-rdf/GUIRoleTaxonomy#">
 ...
  <div role="checkbox"/>
  <div role="wairole:checkbox"/>

In other vocabularies such as SVG, the namespaced role attribute has to be used:

<svg xmlns="http://www.w3.org/2000/svg"
     xmlns:h="http://www.w3.org/1999/xhtml">
 ...
 <circle h:role="checkbox" .../>

UAs must process the value of a role attribute in no namespace that is part of an element in the http://www.w3.org/1999/xhtml namespace as described below.

UAs must process the value of a role attribute in the http://www.w3.org/1999/xhtml namespace that is part of an element that is not in the http://www.w3.org/1999/xhtml or http://www.w3.org/2002/06/xhtml2/ namespace as described below.

No other attributes are to be processed this way — in particular not any role attributes in the http://www.w3.org/TR/xhtml2 namespace.

XHTML 2.0 defines a role attribute in no namespace on elements in the http://www.w3.org/2002/06/xhtml2/ namespace — how that attribute is to be processed is defined in the XHTML 2.0 specification and does not conflict with this specification in any way.

  1. Let input be the value of the attribute.
  2. Let position be a pointer into input, initially pointing at the start of the string.
  3. Skip whitespace.
  4. If the following eight characters are wairole:, then advance position by 8.
  5. Collect a sequence of characters that are not space characters. The collected sequence represents the role identifier.

In this version of this specification, all but the first roles are ignored.

No namespace lookup of the attribute value is performed in this version of this specification.

What "skip whitespace", "collect a sequence of characters" and "space characters" means is defined in HTML5.

If the role identifier is not the empty string, the UA must expose the role identifier as a string to the AT using accessibility API specific methods, and should map the role identifier to an accessibility API specific role, if there is one. [MAPPING]

Find out what that actually means and define it.

States and Properties

Authors may specify a state or property propertyname (as defined in WAI-ARIA States and Properties) by specifying an attribute aria-propertyname in no namespace on an element in the http://www.w3.org/1999/xhtml namespace, or by specifying an attribute propertyname in the http://www.w3.org/2005/07/aaa namespace on an element in any namespace, unless that element is in the http://www.w3.org/1999/xhtml namespace and it has an aria-propertyname attribute in no namespace specified. [STATES]

The value of these attributes must be one of the allowed values of the state or property propertyname (as defined in WAI-ARIA States and Properties). [STATES]

Since HTML doesn't do namespaces, the only way to express states or properties declaratively in HTML is by using aria-propertyname attributes, as in the following example:

<div aria-hidden="true">...</div>

In XHTML, the following are allowed:

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:aaa="http://www.w3.org/2005/07/aaa">
 ...
  <div aria-hidden="true">...</div>
  <div aaa:hidden="true">...</div>

In other vocabularies such as SVG, the namespaced attribute has to be used:

<svg xmlns="http://www.w3.org/2000/svg"
     xmlns:aaa="http://www.w3.org/2005/07/aaa">
 ...
 <g aaa:hidden="true">...</g>

UAs must process an aria-propertyname attribute in no namespace that is part of an element in the http://www.w3.org/1999/xhtml namespace as described below, unless that element has a propertyname attribute in the http://www.w3.org/2005/07/aaa namespace specified.

UAs must process a propertyname attribute in the http://www.w3.org/2005/07/aaa namespace that is part of an element in any namespace as described below.

No other attributes are to be processed in this way — in particular not propertyname attributes in no namespace on elements in the http://www.w3.org/1999/xhtml namespace (as in e.g. <div hidden="true"/>).

  1. Map propertyname to an accessibility API specific attribute, if any, and pass along the value. [MAPPING]

References

[MODULE]
   http://www.w3.org/MarkUp/2007/ED-xhtml-role-20070606/Overview.html

[ROLES]
   http://www.w3.org/WAI/PF/Group/GUI/ (Member-only)
   or http://www.w3.org/TR/2007/WD-aria-role-20070601/

[STATES]
   http://www.w3.org/WAI/PF/Group/adaptable/ (Member-only)
   or http://www.w3.org/TR/2007/WD-aria-state-20070601/

[MAPPING]
   http://developer.mozilla.org/en/docs/ARIA_to_API_mapping

[XMLNS]
   http://www.w3.org/TR/2006/REC-xml-names-20060816/