ARIA Proposal (2007-09-26)

Scripting is disabled and therefore annotations cannot be shown.
<!doctype html>
<meta charset=utf-8>
<title>ARIA Proposal</title>
<link rel=stylesheet href=http://www.whatwg.org/style/specification>
<body class=draft>
<div class=head>
 <h1>ARIA Proposal</h1>
 <h2>Work in Progress &mdash; Last Update 26 September 2007</h2>
 <dl>
  <dt>Editor
  <dd>Simon Pieters, Opera Software, simonp@opera.com
  <dt>Contributor
  <dd>Aaron Leventhal, IBM, aleventh@us.ibm.com
 </dl>
</div>
<h2>Abstract</h2>
<p class=big-issue>...
<p class=big-issue>This spec assumes that HTML elements are in the <code>http://www.w3.org/1999/xhtml</code> namespace, as required by HTML5.
<p class=big-issue>What authors are allowed to do should probably be constrained, and UAs should perhaps ignore some roles or states in certain cases.
<h2>The <code>role</code> attributes</h2>
<p>Authors may specify a <code>role</code> attribute in no namespace on any element in the <code>http://www.w3.org/1999/xhtml</code> namespace.
<p>Authors may specify a <code>role</code> attribute in the <code>http://www.w3.org/1999/xhtml</code> namespace on any element that is not in the <code>http://www.w3.org/1999/xhtml</code> or <code>http://www.w3.org/2002/06/xhtml2/</code> namespace.
<p>The value of these attributes must be an <span>unordered set of space-separated tokens</span> where each token must be a <span>valid role identifier</span>.
<p class=note>What "<a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/section-common1.html#unordered">unordered set of space-separated tokens</a>" means is defined in HTML5.
<p>A <dfn>valid role identifier</dfn> is one of the following:
<ul>
 <li>A role as defined in WAI-ARIA Roles or XHTML Role Attribute Module. [ROLES] [MODULE]
 <li>The eight characters <code>wairole:</code> followed by a role as defined in WAI-ARIA Roles or XHTML Role Attribute Module, if there is a namespace declaration in scope that binds the prefix <code>wairole</code> to the <code>http://www.w3.org/2005/01/wai-rdf/GUIRoleTaxonomy#</code> namespace. [ROLES] [MODULE] [XMLNS]
 <li>A prefixed name whose prefix is not <code>wairole</code>, if there is a namespace declaration in scope that defines the prefix and that prefix is not bound to the <code>http://www.w3.org/2005/01/wai-rdf/GUIRoleTaxonomy#</code> namespace. [XMLNS]
</ul>
<p class=note>Thus the roles defined in the XHTML Role Attribute Module are effectively moved to the <code>http://www.w3.org/2005/01/wai-rdf/GUIRoleTaxonomy#</code> namespace.
<p class=note>The <code>wairole</code> prefix is thus fixed to the <code>http://www.w3.org/2005/01/wai-rdf/GUIRoleTaxonomy#</code> namespace, just like the <code>xml</code> prefix is fixed to the <code>http://www.w3.org/XML/1998/namespace</code> namespace in XML. However, unlike the <code>xml</code> prefix, the <code>wairole</code> prefix has to be declared before it is used according to this specification.
<div class=example>
 <p>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:
 <pre>&lt;div role="checkbox">&lt;/div></pre>
 <p>In XHTML, the following is allowed:
 <pre>&lt;html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:wairole="http://www.w3.org/2005/01/wai-rdf/GUIRoleTaxonomy#">
 ...
  &lt;div role="checkbox"/>
  &lt;div role="wairole:checkbox"/></pre>
  <p>In other vocabularies such as SVG, the namespaced <code>role</code> attribute has to be used:
  <pre>&lt;svg xmlns="http://www.w3.org/2000/svg"
     xmlns:h="http://www.w3.org/1999/xhtml">
 ...
 &lt;circle h:role="checkbox" .../></pre>
</div>
<p>UAs must process the value of a <code>role</code> attribute in no namespace that is part of an element in the <code>http://www.w3.org/1999/xhtml</code> namespace as described below.
<p>UAs must process the value of a <code>role</code> attribute in the <code>http://www.w3.org/1999/xhtml</code> namespace that is part of an element that is not in the <code>http://www.w3.org/1999/xhtml</code> or <code>http://www.w3.org/2002/06/xhtml2/</code> namespace as described below.
<p class=note>No other attributes are to be processed this way &mdash; in particular not any <code>role</code> attributes in the <code>http://www.w3.org/TR/xhtml2</code> namespace.
<p class=note>XHTML 2.0 defines a <code>role</code> attribute in no namespace on elements in the <code>http://www.w3.org/2002/06/xhtml2/</code> namespace &mdash; 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.
<ol>
 <li>Let <var>input</var> be the value of the attribute.
 <li>Let <var>position</var> be a pointer into <var>input</var>, initially pointing at the start of the string.
 <li><span>Skip whitespace</span>.
 <li>If the following eight characters are <code>wairole:</code>, then advance <var>position</var> by 8.
 <li><span>Collect a sequence of characters</span> that are not <span>space characters</span>. The collected sequence represents the <dfn>role identifier</dfn>.
</ol>
<p class=note>In this version of this specification, all but the first roles are ignored.
<p class=note>No namespace lookup of the attribute value is performed in this version of this specification.
<p class=note>What "<a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/section-common1.html#skip-whitespace">skip whitespace</a>", "<a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/section-common1.html#collect">collect a sequence of characters</a>" and "<a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/section-common1.html#space">space characters</a>" means is defined in HTML5.
<p>If the <span>role identifier</span> is not the empty string, the UA must expose the <span>role identifier</span> as a string to the AT using accessibility API specific methods, and should map the <span>role identifier</span> to an accessibility API specific role, if there is one. [MAPPING]
<p class=big-issue>Find out what that actually means and define it.
<h2>States and Properties</h2>
<p>Authors may specify a state or property <var>propertyname</var> (as defined in WAI-ARIA States and Properties) by specifying an attribute <code>aria-<var>propertyname</var></code> in no namespace on an element in the <code>http://www.w3.org/1999/xhtml</code> namespace, or by specifying an attribute <code><var>propertyname</var></code> in the <code>http://www.w3.org/2005/07/aaa</code> namespace on an element in any namespace, unless that element is in the <code>http://www.w3.org/1999/xhtml</code> namespace and it has an <code>aria-<var>propertyname</var></code> attribute in no namespace specified. [STATES]
<p>The value of these attributes must be one of the allowed values of the state or property <var>propertyname</var> (as defined in WAI-ARIA States and Properties). [STATES]
<div class=example>
 <p>Since HTML doesn't do namespaces, the only way to express states or properties declaratively in HTML is by using <code>aria-<var>propertyname</var></code> attributes, as in the following example:
 <pre>&lt;div aria-hidden="true">...&lt;/div></pre>
 <p>In XHTML, the following are allowed:
 <pre>&lt;html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:aaa="http://www.w3.org/2005/07/aaa">
 ...
  &lt;div aria-hidden="true">...&lt;/div>
  &lt;div aaa:hidden="true">...&lt;/div></pre>
 <p>In other vocabularies such as SVG, the namespaced attribute has to be used:
 <pre>&lt;svg xmlns="http://www.w3.org/2000/svg"
     xmlns:aaa="http://www.w3.org/2005/07/aaa">
 ...
 &lt;g aaa:hidden="true">...&lt;/g></pre>
</div>
<p>UAs must process an <code>aria-<var>propertyname</var></code> attribute in no namespace that is part of an element in the <code>http://www.w3.org/1999/xhtml</code> namespace as described below, unless that element has a <code><var>propertyname</var></code> attribute in the <code>http://www.w3.org/2005/07/aaa</code> namespace specified.
<p>UAs must process a <code><var>propertyname</var></code> attribute in the <code>http://www.w3.org/2005/07/aaa</code> namespace that is part of an element in any namespace as described below.
<p class=note>No other attributes are to be processed in this way &mdash; in particular not <code><var>propertyname</var></code> attributes in no namespace on elements in the <code>http://www.w3.org/1999/xhtml</code> namespace (as in e.g. <code>&lt;div hidden="true"/></code>).
<ol>
 <li class=big-issue>Map <var>propertyname</var> to an accessibility API specific attribute, if any, and pass along the value. [MAPPING]
</ol>
<h2>References</h2>
<pre class=big-issue>
[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/
</pre>