Closed Bug 1695116 Opened 4 years ago Closed 3 years ago

Make Windows use RemoteAccessible for tree navigation and role

Categories

(Core :: Disability Access APIs, task)

Desktop
Windows
task

Tracking

()

RESOLVED FIXED
91 Branch
Tracking Status
firefox91 --- fixed

People

(Reporter: Jamie, Assigned: Jamie)

References

(Blocks 1 open bug)

Details

Attachments

(11 files)

(deleted), text/x-phabricator-request
Details
(deleted), text/x-phabricator-request
Details
(deleted), text/x-phabricator-request
Details
(deleted), text/x-phabricator-request
Details
(deleted), text/x-phabricator-request
Details
(deleted), text/x-phabricator-request
Details
(deleted), text/x-phabricator-request
Details
(deleted), text/x-phabricator-request
Details
(deleted), text/x-phabricator-request
Details
(deleted), text/x-phabricator-request
Details
(deleted), text/x-phabricator-request
Details

Once Windows has a separate class hierarchy, it should be possible to have it use RemoteAccessible for anything that doesn't require a sync IPC call. For now, this is only tree navigation and role. Of course, this should be done behind a pref.

This will require a lot of fail-early checks for other IAccessible methods to prevent crashes.

Depends on: 1710976

With the cache disabled (which was previously always the case), we create a RemoteAccessibleWrap for each RemoteAccessible, stored as the RemoteAccessible's "Wrapper".
This in turn creates an MsaaAccessible.
However, both of these are little more than stubs: the MsaaAccessible itself is never returned to clients and most of the methods would crash if called.
They exist only to store the MSAA id received from the content process and to return the COM proxy from the content process to clients.

With the cache enabled, we now create a real MsaaAccessible for each RemoteAccessible, stored as the RemoteAccessible's "Wrapper".
This MsaaAccessible is directly returned to clients.
Soon, it will generate its own id in the parent process and will delegate to the underlying RemoteAccessible to serve queries from clients.

As part of this:

  1. We stop managing COM proxies in the parent process when the cache is enabled, since we don't need those and can't store them anyway.
  2. We stop setting the id on the MsaaAccessible when the cache is enabled, since it will soon generate its own id like local MsaaAccessibles do.
  3. OuterDocAccessible::ChildCount had to be tweaked so it doesn't try to return a RemoteAccessibleWrap when the cache is enabled. (It previously called RemoteChildDocAccessible, which fetches a RemoteAccessibleWrap.)
  1. Add support for RemoteAccessible in MsaaAccessible::GetFrom.
  2. Add an overload of MsaaDocAccessible::GetFrom which accepts a (remote) DocAccessibleParent.
  3. Add MsaaDocAccessible::GetFromOwned to return the containing document's MsaaDocAccessible for a given Accessible.
  4. MsaaAccessible::LocalAcc now returns null for a RemoteAccessible, rather than just assuming the accessible is local.
  5. MsaaAccessible::NativeAccessible now supports retrieving a native client pointer for LocalAccessibles, RemoteAccessibles and RemoteAccessibleWraps.
  1. Make MsaaDocAccessible id maps contain Accessibles instead of AccessibleWraps. This allows us to put RemoteAccessibles in the id map.
  2. Make MsaaAccessible::MsaaShutdown and GetChildIDFor handle RemoteAccessibles. GetChildIDFor lazily generates an id, Just as it does for LocalAccessible.
  1. GetHWNDFor and FireWinEvent now take an Accessible and support RemoteAccessible.
  2. The Proxy*Event methods pass a RemoteAccessible instead of a RemoteAccessibleWrap, since RemoteAccessibleWraps aren't used with the cache enabled. FireWinEvent retrieves the RemoteAccessibleWrap if the cache is disabled.

For now, a lot of interfaces are disabled, since they don't support RemoteAccessibles at all.

Sending these doesn't really do any harm, as we already disregard them in the parent process.
However, it's certainly unnecessary and wasteful.

This isn't used and thus isn't necessary.
Also, we can currently only support 127 content processes because of this id allocation, so avoiding this removes that restriction.

Blocks: 1713272
Blocks: 1713551
Pushed by jteh@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/56ac84b2eae0 part 1: When the cache is enabled, use a real MsaaAccessible for RemoteAccessibles. r=morgan https://hg.mozilla.org/integration/autoland/rev/517f726f1c3e part 2: Support RemoteAccessible in various utility functions. r=morgan https://hg.mozilla.org/integration/autoland/rev/b441f1c4bf99 part 3: Id management for remote MsaaAccessibles with the cache enabled. r=morgan https://hg.mozilla.org/integration/autoland/rev/d52bb54ca76a part 4: Support events for RemoteAccessibles with the cache enabled. r=morgan https://hg.mozilla.org/integration/autoland/rev/232ba8d9bcd2 part 5: Initial support for RemoteAccessibles in QueryInterface. r=morgan https://hg.mozilla.org/integration/autoland/rev/b067a69fc41b part 6: Support retrieval of remote MsaaAccessibles via MSAA child id. r=morgan https://hg.mozilla.org/integration/autoland/rev/84745f573a55 part 7: Support MSAA accParent, accChildCount and accNavigate for RemoteAccessibles. r=morgan https://hg.mozilla.org/integration/autoland/rev/55273d675037 part 8: Support MSAA accRole for RemoteAccessibles. r=morgan https://hg.mozilla.org/integration/autoland/rev/52c836904523 part 9: Fail gracefully for MSAA methods which don't support RemoteAccessible yet instead of crashing. r=morgan https://hg.mozilla.org/integration/autoland/rev/185d685563d9 part 10: When the cache is enabled, don't send COM proxies and MSAA ids from the content process. r=morgan https://hg.mozilla.org/integration/autoland/rev/804044733a13 part 11: When the cache is enabled, don't generate an MSAA id for each content process. r=morgan
Blocks: 1715230
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: