gecko-dev/accessible/ipc/win/handler
James Teh e09b8a6240 Bug 1798098: Prevent a11y tree walks by the Suggested Actions feature in Windows 11 22H2. r=nlapre
The patches in bug 1774285 prevent Suggested Actions a11y tree walking in most cases.
However, when a11y is already enabled, we can still get into a tree walk that triggers a hang when using Copy Phone Number on a tel: link.
This is because there is no selected text in this case, so Suggested Actions falls back to walking the tree.

This patch prevents these walks by returning 1 from get_nSelections within a timeout period after setting the clipboard, indicating that there is a selection when there isn't really.
Unfortunately, even though we lie about the selection count, the selection reported by get_selection still isn't valid.
Fixing that for a selection deep in the tree is difficult; we don't have enough information in the parent process to fake the selection properly.
Thus, Suggested Actions might then do a normal tree walk from the document, so we also return a 0 child count within this timeout period.
With the cache disabled, in-process Windows clients access content process Accessibles using COM proxies.
We must therefore hack get_nSelections and get_accChildCount in AccessibleHandler, which wraps these COM proxies for in-process clients.
This means that Firefox needs to be installed in order for this to work, since AccessibleHandler can only be used with an installed copy.
A11y performance without the cache is very poor without AccessibleHandler anyway.
Because AccessibleHandler is an entirely separate dll, we need to duplicate the suppression logic in AccessibleHandlerControl, which can be accessed by both Gecko and AccessibleHandler.

After all these attempts on the document, Suggested Actions falls back to walking from the root.
To prevent that walk, we return 0 for the child count on the root MsaaAccessible within the timeout period.

Differential Revision: https://phabricator.services.mozilla.com/D160746
2022-11-04 02:31:10 +00:00
..
AccessibleHandler.cpp Bug 1798098: Prevent a11y tree walks by the Suggested Actions feature in Windows 11 22H2. r=nlapre 2022-11-04 02:31:10 +00:00
AccessibleHandler.def
AccessibleHandler.h
AccessibleHandler.rc
AccessibleHandlerControl.cpp Bug 1798098: Prevent a11y tree walks by the Suggested Actions feature in Windows 11 22H2. r=nlapre 2022-11-04 02:31:10 +00:00
AccessibleHandlerControl.h Bug 1798098: Prevent a11y tree walks by the Suggested Actions feature in Windows 11 22H2. r=nlapre 2022-11-04 02:31:10 +00:00
HandlerChildEnumerator.cpp
HandlerChildEnumerator.h
HandlerData.acf
HandlerData.idl Bug 1798098: Prevent a11y tree walks by the Suggested Actions feature in Windows 11 22H2. r=nlapre 2022-11-04 02:31:10 +00:00
HandlerDataCleanup.h
HandlerDataUUID.h.in
HandlerRelation.cpp
HandlerRelation.h
HandlerTextLeaf.cpp
HandlerTextLeaf.h
moz.build