Repository navigation
feat(shell): a hook through which the embedder changes each accessibility tree built - #15
Merged
Merged
Conversation
…lity tree built `View::set_accessibility_tree_hook` passes every tree built for the window through the embedder's function before the adapter sees it, at each of the three places Blitz builds one (the first request, a poll with changes, an explicit rebuild). An embedder can then describe a node the page's markup cannot: leaf's editor, which draws its document as rows of divs, becomes a text area with its value, text runs and selection. What assistive tech asks of such a node already reaches the embedder as an action request.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
View::set_accessibility_tree_hook(f)passes every AccessKit tree built for a window throughf(&BaseDocument, &mut TreeUpdate)before the adapter sees it;View::clear_accessibility_tree_hookremoves it. It runs at all three places Blitz builds a tree: the adapter's first request, a poll that finds changes, andView::build_accessibility_tree.Why: leaf's editor draws its document as rows of divs, so it reaches assistive tech as static text, with no value, selection or caret, and nothing an agent can set through AX. With the hook, leaf turns the editor's node into a
MultilineTextInputwith its value,TextRunchildren (character lengths, positions, widths, word starts) and the text selection. The requests that follow (SetValue,SetTextSelection) already reach the embedder asBlitzShellEvent::Accessibility.FORK.md lists it under "What is on
leaf".Checked:
cargo check -p blitz-shell,cargo fmt --check,cargo doc -p blitz-shell. Local clippy (Rust 1.99) fails on blitz-dom and blitz-paint code this change does not touch; CI's toolchain decides. Leaf's side, which uses it, is in diaryx-org/leaf (branchtext-accessibility).WPT results
Subtests: 1621 newly passing, 796 newly failing (net +825). Tests: 20 added, 130 removed. Crashes: +25. Timeouts: -2.
Subtest changes by area (75 areas)
Full diff (283 changed tests)
Generated by the WPT workflow.