Closed Bug 1886371 Opened 7 months ago Closed 7 months ago

[UIA] Implement foundations of native UIA implementation

Categories

(Core :: Disability Access APIs, task)

Desktop
Windows
task

Tracking

()

RESOLVED FIXED
126 Branch
Tracking Status
firefox126 --- fixed

People

(Reporter: Jamie, Assigned: Jamie)

References

(Blocks 1 open bug)

Details

Attachments

(8 files)

Our current UIA implementation is based on IAccessibleEx. We want to do a proper native implementation because the IA2 -> UIA proxy is very slow (see bug 762769 comment 4) and has other bugs/quirks beyond our control.

In this bug, we will respond to WM_GETOBJECT as native UIA expects, implement tree traversal, and get our existing (small) UIA test suite passing.

  1. Respond to WM_GETOBJECT with our IRawElementProviderSimple implementation for the root Accessible of the HWND.
  2. Don't allow QueryInterface to UIA interfaces if the UIA pref is disabled. This stops WM_GETOBJECT from returning our UIA implementation in this case.
  3. Specify the appropriate provider options.

Our IUnknownImpl macros avoid boilerplate, but they weren't designed to handle the quirky inheritance of our MSAA/UIA implementation.
Among other things, using these macros required us to override AddRef and Release in uiaRawElmProvider, which was a bit confusing.
Rather than perpetuating this weirdness as things get more complex, just implement what we need by hand.

This is how UIA traverses the tree.

This identifies the root of our implementation and allows for focus querying and hit testing.
We also implement IRawElementProviderSimple::get_HostRawElementProvider to connect to UIA's HWND provider.

We need this for our tests so they can find elements they're testing.

The actual ControlType property implementation is the subject of a subsequent patch.

Aside from being a fundamental part of semantics, this is needed for our tests.
These mappings are based on the Core AAM and HTML AAM specs, plus some personal judgement where Gecko roles weren't covered by these specs.
UIA control types are rather limited and they apparently expect us to expose a lot of things using LocalizedControlType, but that isn't implemented for now.
I expect these will need to be revised in future, but this is a starting point.

See the code comments for explanation.

Blocks: 1886618
Blocks: 1886619
No longer blocks: 1886619
Blocks: 1886937
Pushed by jteh@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/7a390b42c154 part 1: Hook up our native UIA tree. r=nlapre,win-reviewers,rkraesig https://hg.mozilla.org/integration/autoland/rev/99e2e8077f6c part 2: Refactor uiaRawElmProvider::QueryInterface. r=nlapre https://hg.mozilla.org/integration/autoland/rev/106d9f34baf0 part 3: Implement IRawElementProviderFragment. r=nlapre https://hg.mozilla.org/integration/autoland/rev/0535814eafd8 part 4: Implement IRawElementProviderFragmentRoot. r=nlapre https://hg.mozilla.org/integration/autoland/rev/99f3316bea22 part 5: Implement the UIA AutomationId property. r=nlapre https://hg.mozilla.org/integration/autoland/rev/6a0c55ad599b part 6: Add UIA control types to RoleMap. r=nlapre https://hg.mozilla.org/integration/autoland/rev/46bbfc5941c2 part 7: Implement UIA ControlType property. r=nlapre https://hg.mozilla.org/integration/autoland/rev/19d905446a32 part 8: Tweak the test harness so that it uses native UIA when it is enabled. r=nlapre
Regressions: 1887584
Regressions: 1887590
See Also: → 1776965
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: