Friday, June 8, 2012

UIA implementation in Firefox

We decided to start implementation of UI Automation (UIA) in Firefox. Some reasons of doing this:
  • UIA is considered as electronic curb cut effect. For example, it's used by Windows speech recognition and it's critical part to make your application working properly on Windows 8 Metro.
  • MSAA to UIA bridge is not good from performance perspective, for example, Firefox is getting slow when speech recognition is running.
  • By doing UIA Firefox can support Microsoft Narrator what is a plus.
We are going to make the work by parts starting from IAccessibleEx approach. You can watch our meta bug to follow the progress.

Some parts of UIA differs from IAccessible2 API, for example, text support is based on another concept. Thus it's going to take a while before you can try out something. During the implementation stage we think to keep UIA support disabled by default.

If you are contributor and you would like to help us with UIA implementation then you're welcome. You need to do some extra steps to what I wrote previously.
  • Follow these steps to build Firefox on Windows 8. Note, until the mozilla-build release doesn't contain proper scripts you need to obtain them from mozilla-build repo and copy them into your mozilla-build installation folder.
  • Add 'accessible.uia.enabled' pref and set it to true.
  • Check out this bug list to find a bug to work on.

Firefox 15: what's new for AT developers

Firefox 15 is in aurora channel now. This release doesn't have a lot of features interesting for AT developers. Primarily we were focused on under the hood work. But none the less.

ARIA

As you know some ARIA state and properties are exposed via accessible object attributes. Basically ARIA attribute is mapped to accessible object attribute when there's no proper mapping to accessibility API, for example, in case of aria-sort attribute. As consequence this is applicable for any unknown ARIA attribute. Thus if you have something like:
  <div aria-myownproperty="myvalue"></div>
then Firefox exposes "myownproperty:myvalue" object attribute.

Whenever the ARIA attribute value is changed Firefox should fire IA2_EVENT_OBJECT_ATTRIBUTE_CHANGED event. Prior Firefox 15 the event was missed in some cases.

HTML

The bug when row accessible of the table (ATK_ROLE_LIST_ITEM / ROLE_SYSTEM_ROW) wasn't created for layout tables was fixed. Example:
  <div style="display: table;">
    <div style="display: table-row;">
      <div style="display: table-cell;">cell</div>
    </div>
  </div>
Thanks to MichaƂ Frontczak for this contribution.

Events

The major change that may affect on ATs is we started to fire document loading events on iframe documents. Prior to Firefox 15 they were restricted to tab documents. So if you, for example, change @src attribute on HTML iframe element then it causes LOAD_COMPLETE event on the document accessible loaded into the iframe. The same time if loading document contains sub documents (for example, a tab page containing iframe elements) then there's only one event fired on the document, in other words, document loading events are fired on root of the documents loading chain. Refer here for more information.

Correctness and performance

Finally the list bullet accessible boundaries bug was fixed. Also we fixed a regression that IAccessible2 state defunt wasn't exposed on defunct accessible.

Bunch of performance bugs were fixed. Overall performance was improved. Thanks to Mark Cappela and others for this good work. Also we made accessible states computation noticeable faster. This should make the screen reader user experience a little bit smoother.

XPCOM

A quick update on XPCOM support for those who use it in Firefox add-ons. We introdroduced new roles for HTML definition elements
  • dl element: nsIAccessibleRole.ROLE_DEFINITION_LIST
  • dt element: nsIAccessibleRole.ROLE_TERM
  • dd element: nsIAccessibleRole.ROLE_DEFINITION
Also nsIAccessible.numAction attribute was renamed to nsIAccessible.actionCount for consistence with other interfaces.