Fuchsia Accessibility View

Overview

The scenic view is the basic unit of fuchsia graphics. Beyond rendering graphical content, scenic views also confer several capabilities of interest to the accessibility manager, namely:

  1. Manipulating view focus.
  2. Receiving input.
  3. Injecting input.
  4. Rendering content (e.g. screen reader focus highlights).
  5. Applying transforms to descendants' content (e.g. magnification).

As opposed to offering these capabilities to the accessibility manager through a set of privileged APIs, we prefer instead to vend them via an accessibility-owned view near the root of the scene.

Motivation

The accessibility manager and input system can both benefit from an accessibility-owned view as a close descendant of the scene root. Benefits include:

  1. Simplified input logic in scenic. Without the accessibility view, scenic would need to make special accommodations to ensure that the accessibility manager receives input events, and has the first opportunity to claim them. An accessibility-owned view allows scenic to dispatch input events to the accessibility manager via essentially the same mechanism as it does to a “normal” view. Moreover, the accessibility view’s position at the top of the scene graph implicitly gives it input precedence over other views.

    NOTE: This is a desired future state. Currently, accessibility still consumes input through a dedicated API.

  2. Reduced input latency. Without the accessibility view, the “special accommodations” mentioned above would introduce additional latency for all incoming input events when assistive technologies are enabled.

  3. Fewer privileged APIs. Without the accessibility view, we would need dedicated APIs for the accessibility manager to perform magnification, draw highlights, receive input, control focus, inject input, etc.

High-level architecture

The accessibility manager inserts a view into the scene, owned by either root presenter or scene manager, at startup (exact details of the handshake to insert the accessibility view are beyond the scope of this document). The accessibility view is a close descendant of the scene root (see “Scene toplogy” below). This decision is deliberate, as it allows us to guarantee the following properties:

  1. Accessibility receives priority for input. Ancestor views have input precedence over their descendants.
  2. The entire UI falls under the accessibility view's jurisdiction. View capabilities are generally restricted to their scene subgraphs, so this property ensures that the accessibility manager can, e.g., manipulate focus and inject input into UI views.

Scene topology

TODO.