Open Bug 2008642 Opened 10 months ago Updated 11 days ago

Consider timeout-based instantiation for unknown macOS a11y clients

Categories

(Core :: Disability Access APIs, defect)

Desktop
macOS
defect

Tracking

()

People

(Reporter: morgan, Unassigned)

References

(Blocks 1 open bug)

Details

The macOS accessibility API is used by many utility programs (e.g. window managers) that do not follow traditional (undocumented) API conventions. These consumers often enable the accessibility API in Firefox but do not disable it/deregister themselves as a consumer once they no longer need API access. As a result, we maintain the accessibility tree and fire all accessibility events, even when no one is listening :)

I propose we adopt a timeout-based instantiation for unknown macOS clients. This might look something like the following:

  1. An unknown client queries firefox for a11y information. We instantiate the a11y engine and create a timer with a registered callback. This callback will deactivate the a11y engine. We respond to the unknown client's request for information.
  2. The unknown client continues to send queries. At each query, we re-up the timeout timer to its original value to push the timeout farther into the future. Repeat this step for any received query.
  3. The unknown client stops sending queries. This causes the timeout timer to expire, the callback is called and the accessibility engine is deactivated.
  4. The unknown client sends a new query, after the a11y engine has been shut down. We restart this process, see step 1.
  5. An unknown client is active in tandem with a known client like VoiceOver or Switch. We remove the timer and deregister the callback. The a11y engine will remain on until the known client is deactivated, at which point if the unknown client is still present the timer will start.

For known clients, we can observe changes to this attribute and shutdown if there are no other consumers.

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