This article provides a quick guide to how accessibility is handled in Gecko for XForms.. Assistive technologies API for XForms is supported starting from Firefox 3 (Gecko 1.9). Implementation of accessible objects for XForms elements is based on top of the existing object hierarchy introduced in the Mozilla accessibility module. XForms elements behavior is implemented in accordance with accessible toolkit checklist.
In general, when elements are similar to HTML elements, they are exposed to MSAA/ATK in a similar way.
Subsections below explain how you can obtain accessible XForms-enabled build. These are either downloading latest build of firefox or building it yourself.
For Firefox, you may directly download the nighly "trunk" build of Firefox and install the XForms extension which lives in 'xpi' directory of the build. Note, XForms accessibility is implemented only on trunk. Trunk builds are not considered stable and should not be installed on top of the Firefox used for daily browsing. Currently we have verified that XForms accessibility is working on the Windows platform, and Linux testing has not yet been done, although everything should work and is ready to be tested. You will find trunk builds of Firefox at ftp.mozilla.org, trunk builds of XForms extension (Windows) at ftp.mozilla.org or trunk builds of XForms extension (Linux) ftp.mozilla.org.
Build It Yourself
If you would like to build firefox/seamonkey yourself then please ensure your .mozconfig file has the following option:
- ac_add_options --enable-extensions=default,xforms,schema-validation
How To Test
There are two approaches to test XForms accessibility. The first is to use and assistive technology such as a screen reader, or an accessibility testing tool, to make sure XForms elements have proper accessible objects. Or you may be guided by toolkit checklist to check keyboard navigation for XForms controls.
You can try the following link to test XForms accessibility:
- visual XForms elements in XHTML document at bugzilla.mozilla.org
- visual XForms elements in XUL document at bugzilla.mozilla.org
- you can see XForms sample tests at Mozilla XForms project
- there are set of tests at beaufour.dk
- W3C's XForms test at w3.org
Keyboard Navigation Issues
Though XForms spec declares
navindex attribute to define the navigation sequence (see 1.0 specs or 1.1 specs) but Rich Schwerdtfeger (Distinguished Engineer, SWG Accessibility Architect/Strategist Chair, IBM Accessibility Architecture Review Board) gave some clarification about
navindex. He wrote:
Navindex was in XForms - it was stripped out as it was believed the focus model was dependent on the content which used it. So, yes we don't care about navindex in XForms. If you use xhtml1.x use tabindex. If you use Xhtml2 use nextfocus.
Therefore since Mozilla XForms works in XHTML (1.x) or XUL documents only then we use
tabindex instead. Note, we support
-moz-user-focus style neither for XHTML or XUL.
This section describes common rules how accessibility properties are formed for forms control elements.
It is formed from value of child XForms
label element if the element doesn't have
It is formed from value of child XForms
hint element if the element doesn't have
It is formed as well from model item properties (MIPs) of instance node that XForms element is bound to as from valid/invalid or in-range/out-of-range states of instance node. Instance node states are mapped to accessibility state constants declared in
nsIAccessibleStates interface like it shown below:
- relevant - STATE_UNAVAILABLE
- readonly - STATE_READONLY
- required - STATE_REQUIRED
- invalid - STATE_INVALID
- out of range - STATE_INVALID
Mozilla XForms implementation allows form control elements to have child elements. Therefore accessible children are formed from any accessible child elements of form control element and from elements that are introduced by its presentation.
Forms Controls Module
Some of form control elements may be represented in few ways by different widgets. This section lists accessible presentations for form control elements.
- text field - see the docs.
- checkbox - see the docs
- datepicker - see the docs.
- calendar - see the docs.
- days list - see the docs.
- months list - see the docs.
These elements may be used as child elements to the form controls described above. Some of these elements are not accessible itself but they makes accessibility properties for XForms elements that hold them.
Specifies the label for the xforms control (see the spec, the docs). Every form control other than the
output element must contain a
label element. The value of
label element is used as name of accessible object.
This message will be shown when the form control cannot properly bind to instance data or when the instance data value is invalid or out of the specified range of selectable values (see the spec, the docs). The
alert element has
ROLE_ALERT role for both usual and inline
Below you will find a list of XForms/Accessiblity resources: