Introduction
This article shows how XUL control elements are mapped to accessibility API. It is much in progress.
AT API
General rules
This section holds some rules applied to generating accessible name and description.
Aggregating the text from element subtree
- if the child node is hidden then it's ignored excepting the case when the element used as label is hidden itself
- If the child node is text node then its rendered value is appended
- If the child node is element then
- if it implements
nsIDOMXULLabeledControlElementthen the value oflabelproperty is appended - otherwise
- if it's a
labelelement then thenvalueattribute is appended - otherwise append
tooltiptextattribute
- if it's a
- append the accessible value
- if it implements
Searching specific element in neighbour of the element
- search inside the element subtree
- go up through parents (max level is 5) and search inside theirs subtrees
- if the element is anonymous then search in whole anonymous subtree, here the attribute
anonidis used instead ofidattribute
Accessible properties
This section describes common rules how accessibility properties are formed for XUL elements.
name
The following rules to generate accessible name are applied:
- check
aria-labelledbyattribute, name is generated from elements pointed byaria-labelledbyattribute
<description id="descr1">label1</description> <description id="descr2">label2</description> <textbox aria-labelledby="descr1 descr2" />
- if the element implements
nsIDOMXULLabeledControlElementornsIDOMXULSelectControlItemElementinterface then it is usedlabelproperty - if the element doesn't implement
nsIDOMXULSelectControlElementthenlabelattribute is used - if neighbour of the element has
labelelement pointing to this element by thecontrolattribute, if thelabelelement is found then usevalueattribute or its content.
<label value="it's label for control" control="control" /> <hbox role="grouping" id="control" />
- get
tooltiptextattribute - if the element is anonymous child of the element that is the direct child of
toolbaritemelement or the element is direct child oftoolbaritemelement thentitleattribute oftoolbaritemelement is used (currently it's used in Firefox UI only) - if the element has ARIA role and the role allows to aggregate name from subtree of element then generate name from subtree of the element
description
The following rules to generate accessible description are applied:
- check
aria-describedbyattribute, description is generated from elements pointed byaria-describedbyattribute
<description id="descr1">label1</description> <description id="descr2">label2</description> <textbox aria-describedby="descr1 descr2" />
- if neighbour of the element has
descriptionelement pointing to this element by thecontrolattribute, if thedescriptionelement is found then use its content.
<description value="it's label for control" control="control" /> <hbox role="grouping" id="control" />
- get
tooltiptextattribute
value
- If the ARIA role is used and it allows to have accessible value then
aria-valuetextoraria-valuenoware used - If the element is XLink then value is generated from link location
actions
- If the element is XLink then
jumpaction is exposed - If the element has registered
clickevent handler thenclickaction is exposed
XUL Elements
notification
Used to display an informative message. Role ROLE_ALERT