A toolkit that draws its own pixels has to say what it drew. Fusuma does that with a semantic tree: for every widget a role, a name, a state and where it is, kept next to the tree that paints.
What it gives assistive technology
- A semantic tree from the widget tree: roles (button, checkbox, slider, text field, list, image, dialog…), names, values, checked and selected states, focus.
fusuma-accessturns it into an AccessKit tree for desktop, and answers what a screen reader asks as calls on the tree. - The web. A page of ARIA HTML is kept as a hidden DOM next to the canvas and updated as the screen changes. Focus follows, announcements go to a live region, and events from the hidden copy map back to actions on the widgets. A person typing in the hidden copy of a text field types in the real one.
- The keyboard. Every widget that can be used can be reached: Tab and the arrows move focus, Enter and Space activate, and a widget the keyboard moves to is scrolled into view.
- Text size. The font-size setting, 50 to 400 percent, reaches the theme and the layout, and a view reads it to choose one column instead of two.
- Motion. A person who asks for less motion gets the
ReducedorOffbudget. - Language. Strings come through
env.t(key), and text input handles bidirectional text through Parley on the Vello renderers.
It is also how the tests work
fusuma-test finds a widget by its name or role in the same semantic tree. A widget a test cannot find is a widget a screen reader cannot find, so the test suite checks accessibility as a side effect of checking behaviour.
What is checked and what is not
The web page is tested by script against a real browser over the DevTools protocol, and the semantic tree has unit tests. A real screen reader test, with a person, has not been done. Android's TalkBack and iOS's VoiceOver are next, after the mobile hosts run on devices (they run in an emulator and a simulator today).
Source: crates/fusuma-access and crates/fusuma-ui/src/semantic.rs.