Allow AppKit to cache accessible tree
Categories
(Core :: Disability Access APIs, defect, P2)
Tracking
()
People
(Reporter: eeejay, Assigned: eeejay)
References
Details
(Whiteboard: [mac2020_1])
Attachments
(1 external file)
I did some tooling with a simple document:
data:text/html,<p>hello</p><p>world</p><p>i love you</p>
I counted how many times we call AXParent from the web area (ie. the content document), this should give us a very rough estimate to how often VoiceOver/AppKit walks the entire app tree. Let's just call this a "tree walk count".
I also counted how many times we call into accessibilityAttributeValue overall.
When moving with VoiceOver with VO+right from the second to third paragraph we do 1120 tree walks and 10360 attribute retrievals.
I tooled WebKit as well with a counter for AXParent of the web area as well. When doing VO+Right from the second to third paragraph WebKit "tree walks" 63 times.
Chromium and WebKit use different methods to signal to AppKit that their accessible web trees are safe to cache.
- WebKit implements a method called
accessibilityShouldUseUniqueIdwhich returns true. It then callsNSAccessibilityUnregisterUniqueIdForUIElementbefore the accessible is destroyed. - Chromium implements a method called
accessibilityNotifiesWhenDestroyedthat returns true. They then post an accessibility notification calledNSAccessibilityUIElementDestroyedNotification. This seems to be the more modern and documented way.
I chose to try the latter in Gecko. With the test above, pressing VO+Right from second to third paragraph, there are a total of 5 tree walks, and 236 attributes retrieved. Not bad!
| Assignee | ||
Comment 1•6 years ago
|
||
| Assignee | ||
Updated•6 years ago
|
Comment 3•6 years ago
|
||
| bugherder | ||
Comment 4•5 years ago
|
||
Release Note Request (optional, but appreciated)
[Why is this notable]: This fix enables us to announce VoiceOver preview support on macOS.
[Affects Firefox for Android]: No
[Suggested wording]: Firefox 85 Beta offers a preview of VoiceOver screen reader support for macOS users. Navigation and speech should work well for web pages and for most of the Firefox user interface. If you find something isn’t working as expected, please let us know in the #accessibility channel on Matrix.
[Links (documentation, blog post, etc)]: https://wiki.mozilla.org/Accessibility/Mac2020
Description
•