Closed Bug 1618364 Opened 6 years ago Closed 6 years ago

Allow AppKit to cache accessible tree

Categories

(Core :: Disability Access APIs, defect, P2)

All
macOS
defect

Tracking

()

RESOLVED FIXED
mozilla75
Tracking Status
relnote-firefox --- -
firefox75 --- fixed

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 accessibilityShouldUseUniqueId which returns true. It then calls NSAccessibilityUnregisterUniqueIdForUIElement before the accessible is destroyed.
  • Chromium implements a method called accessibilityNotifiesWhenDestroyed that returns true. They then post an accessibility notification called NSAccessibilityUIElementDestroyedNotification. 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!

Priority: -- → P2
Pushed by eisaacson@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d3021d8560f4 Add OSX accessible lifecycle notifications. r=morgan
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla75
Blocks: 772060
Regressions: 1622731

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

relnote-firefox: --- → ?

This was in the 85 beta release notes, not in the final version.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: