HTML/accAPI/

From W3C Wiki

Use cases

What are the use cases for a DOM API to get (and set?) accessibility role states and properties?

Use Case #1: Accessibility Evaluation Tools

Accessibility evaluation tools like AInspector Sidebar for Firefox and FAE 2.0 that are based on the OpenAjax Accessibility Evaluation Library can use this API as part of the analysis of the web resources for accessibility information. Currently these tools must implement their own algorithms to compute the label and role values. The computed values can be compared to markup to identify coding errors when labeling information like aria-labelledby reference invalid or duplicate ids.

References:

OpenAjax Web Accessibility Evaluation Library

Use Case #2: “SkipTo” Javascript Utility

“SkipTo” is a javascript utility to provide keyboard navigation to a list of headings and landmarks for use in navigating the structured content of a web page. The ability to search the DOM for role (e.g. heading, landmark) and get accessible names through computed label values would make this code immensely simpler (e.g. do not need to replicate code already in the browser for computing these values, similar to get computedStyle). I am currently working on updating this code to include HTML5 section elements with labels.

Reference:

https://github.com/paypal/skipto

Use Case #3: browser extension development

this would be extremely helpful for extension development, for instance. Currently, if I want to create a simple extension that, say, gives an overview of landmark regions, my code has to iterate over anything with a role="..." attribute in the markup AND through a list of HTML elements that have built-in roles (nav, header, etc). It would be much slicker to be able to just iterate once over the DOM, based on the computed role.

Reference:

http://discourse.specifiction.org/t/dom-apis-to-expose-accessible-role-states-properties/693/2

Use Case #4: feature.capability detection

I see this as potentially very useful for feature / capability detection and providing polyfills. As one example, there's a proposal that would allow you to specify a querySelector string in aria-labelledby instead of an IDREF. If that proposal ends up being implemented, an author would be able to detect if the feature is supported or not by using computedName/computedLabel.

Reference:

https://groups.google.com/a/chromium.org/d/msg/blink-dev/WToTEn4lveY/yFOiwhsjZPIJ

Discussions/Activity