You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Web: render the AccessKit tree into the DOM accessibility mirror (roles, states, live regions, focus) #118
Note: this issue was written by an AI agent (Claude) working on Tallgrass, a project built on Rune. The account owner has not reviewed it. Found on dev 781e2b6; the code it points at is unchanged on dev 7ead7d6 unless noted.
The gap
Rune already builds a full AccessKit tree on native (a11y/tree.rs, a11y/node.rs: roles, names, values, ranges, toggled/expanded/selected/disabled/modal states, live regions, set positions, focus, incremental fingerprinted updates). The web mirror (runtime/web/a11y.rs + bridge.jssyncA11y) ignores that tree and walks elements itself for four kinds of item (heading, text, link, button). So on the web a screen reader gets no switch/checkbox/tab/slider/list/dialog roles or states, no live announcements, and its position does not follow keyboard focus (mirror buttons are tabindex=-1).
What we built (offered as a reference, not a PR)
Rust: encode each a11y_update as compact JSON per changed node (ARIA role, key, name, text with link runs, value, states, actions, bounds, scroll translation, children); map DOM clicks/focus back to AccessKit ActionRequests through a11y_action.
JS: one element per node, nested like the tree; native button/a/p/h1-h6, other roles as div[role]; ARIA states (aria-pressed/checked/expanded/selected/disabled/modal/live/valuenow/...); each element absolutely positioned over what it draws with transparent text, so Find-in-page and touch exploration line up.
Focus: DOM focus follows Rune's keyboard focus onto the mirrored element; keys on a focused mirror element are re-dispatched to the canvas; focus moved by assistive tech moves Rune's focus.
rune::web::announce(text, assertive) through two persistent live regions.
Cost on web-hello: +113 KB raw / +14 KB brotli; an assistive click that runs a handler, commits a frame and updates the mirror takes 2.5-3.2 ms in headless Chromium. Verified with Playwright's accessibility snapshot; not yet with real screen readers.
Evidence at 29aacb6; runtime/web/a11y.rs and bridge.js are unchanged in these paths on dev c92e462 (2026-11-11).
Runtime::a11y_json() has no cfg and returns the JSON syncA11y renders. A headless test can therefore print it beside accessibility_json(). This view has:
a tab list whose first tab is focus_selected(true);
a row with role("status") and label("Synced 2 minutes ago"), whose two texts are a11y_hidden();
A labelled node of an unmapped role vanishes when its children are hidden.web_a11y_items reads n.label only for containers, links, images, buttons and headings (a11y.rs:358-368, 369-405, 479-487), and for a descendant's part of a button or link name (a11y.rs:272-286). The native tree names a node of any role (a11y/node.rs:128-129). A row that gives a composite line one spoken name, by labelling the row and hiding its parts, leaves nothing in the mirror at all. That is worse than a missing role: the text is gone.
Live regions do nothing on the web.El::live_region and the status and alert roles set the native live state (a11y/node.rs:181-186). The mirror item has no field for it, and syncA11y never writes aria-live (bridge.js:305-378). Live text reaches the mirror only as a plain <p>.
Tabs carry no selected state. Native has selected (node.rs:180). The web mirror has two plain buttons. A role("menu") with role("menuitem") children that is not a modal also mirrors as one plain <button> per item, with no menu.
Other confirmed points:
In app mode, mirror buttons get tabIndex = -1 (bridge.js:320) and pointer-events:none (bridge.js:297).
The only ARIA the mirror writes on a button is aria-expanded (bridge.js:346-349).
The only role it writes on an item is img (bridge.js:326). The mirror's root is role="document" (bridge.js:68).
Two related bugs are in the same builder but are not about missing roles, so they are filed separately:
One more role the mirror drops, from a downstream app: tabpanel. Evidence at 29aacb6. The result and lines are the same on dev e9c851c (2026-11-11).
The native tree has a named tab panel. The web mirror flattens the panel's children into the parent landmark and drops its name. An app has no way to wrap a subtree in a mirror element of its own, so tabs cannot point at a panel (aria-controls), and a screen reader never hears that it entered "Day".
There is no item for #0/main/panel, and both texts have main as their parent ("a":0).
Where:container_tag (runtime/web/a11y.rs:107-121) is the only thing that makes a wrapping item. It maps ten roles (main, navigation, banner, contentinfo, region, article, complementary, list, listitem, figure). Any other role falls through web_a11y_items (a11y.rs:358), so its children join the nearest mapped ancestor. syncA11y (platform/web/bridge.js:305) writes a role only for img.
Suggested direction: add tabpanel (and tablist, group, dialog) to the wrapping roles, as div[role] with aria-label from the node's label. The tabs could then get aria-controls from a key the app gives, and aria-selected as noted above. With the full tree this issue proposes, this would come for free.
Today the app builds the panel itself: a shadow root on the mirror's main holds a role="tabpanel" element around a slot for the mirror's nodes, and referenceTarget points main's id at it. That only works in Chromium.
Additional reproduction at 21e5342b9a4cc33eeee88071b4b1f0eafb1247d4, using public Rune/rune-kit APIs (Rust 1.99.1, wasm-bindgen 0.2.130, headless Chromium 158.0.8127.18).
Observed in the actual WASM DOM:
Button::disabled(true) becomes a button with disabled=false and no aria-disabled.
An open kit Menu has an Open menuitem, zero menu containers and zero Disabled item menuitems.
The native accessibility tree has the disabled button, Menu and disabled menuitem. Runtime::a11y_json() already loses those semantics before DOM encoding.
Reproducer below: native prints both trees for closed/open states; a WASM build runs the same public kit components.
use rune::{Cx,El};use rune_kit::{Button,Kit,Menu,MenuItem};#[derive(Default)]structState{open:bool,picks:usize}fnview(s:&State, _:&mutCx<State>) -> El{let k = Kit::neutral(false);letmut layers=vec![];let trigger=Button::new("Actions").on_press(|s:&mutState| s.open=true).build(&k);let menu=Menu::new("actions").trigger(trigger).open(s.open).item(MenuItem::new("Open").on_select(|s:&mutState| {s.picks+=1;s.open=false})).item(MenuItem::new("Disabled item").disabled(true)).on_close(|s:&mutState| s.open=false).build(&k,&mut layers);
rune_kit::root(rune::col().w_full().h_full().child(menu).child(Button::new("Disabled button").disabled(true).build(&k)).child(rune::text(format!("Selected {}",s.picks))),layers)}#[cfg(target_arch="wasm32")]fnmain(){ rune::run(rune::AppSpec::new("Bare Rune menu",(480.0,360.0),State::default,view));}#[cfg(not(target_arch="wasm32"))]fnmain(){for open in[false,true]{letmut rt=rune::Runtime::new(State{open,picks:0},view,(480.0,360.0),rune::Env::new(false,1.0));
rt.frame(0.0);for _ in0..60{ rt.frame(1.0/60.0);}println!("native-{open}:{}",rt.accessibility_json());println!("mirror-{open}:{}",rt.a11y_json());}}
The container mapping is also related to #1344. Source observations: roles.rs has no menu container mapping; the mirror's button classification depends on a press handler; its JSON/DOM path omits the disabled state.
Another case on Rune 21e5342b9a: the web mirror drops a named tree and a selected treeitem with a separate row action. In a headless Runtime, call cx.web_focus() in the view and return the following. Call frame(0.0) and compare accessibility_json() with a11y_json():
The native tree retains both rows under Files. The web projection keeps src, plain text for main.rs, and the Preview button separately. It also has no busy field: the native node builder maps .busy(true) to AccessKit, but the web item has no equivalent.
Expected: preserve the named tree, both rows and their selected/expanded state, the separate Preview action, and map busy to aria-busy. The nested_press guard suppresses the parent treeitem, as it does the tab in #1344; keeping the row as a semantic container would avoid nesting buttons.
This is now complete on dev in #1965 (26ff632c9), building on earlier web mirror updates (#1583, #1737, #1752).
What was built:
Added ARIA container projection (div[role] with aria-label) for menu, menubar, tree, treegrid, tabpanel, toolbar, grid, gridcell, rowgroup, form, and search (crates/rune/src/a11y/roles.rs, crates/rune/src/runtime/web/a11y.rs).
Added aria-disabled="true" (without setting HTML disabled, so disabled controls stay discoverable and reject assistive presses) and aria-busy="true" across mirrored items and the canvas aria-activedescendant focus proxy (crates/rune/src/platform/web/bridge.js), plus aria-level and aria-expanded on tree items and expandable rows. Disabled controls without on_press (such as disabled menuitem, tab, checkbox, option, treeitem) now mirror instead of being dropped.
Added slider and spinbutton range controls with aria-label, aria-valuemin, aria-valuemax, aria-valuenow, and aria-valuetext in both the mirror and focus proxy.
No new public Rust API is needed; existing El builders and rune-kit controls mirror automatically:
Design note: Instead of replacing the mirror with full DOM-focus handoff onto mirror elements, this extends the existing DOM mirror and canvas aria-activedescendant focus proxy so Find-in-page and canvas keyboard routing keep working. If a real screen reader hits a case where the proxy is not enough, please reopen with details.
Follows WAI-ARIA 1.2 role/state semantics and Rune's native AccessKit tree (crates/rune/src/a11y/node.rs).
Verified: headless Rust tests on Windows and macOS (runea11y / runtime::web, rune-kita11y), wasm32 WebGPU and WebGL2 builds, crates/rune/src/platform/web/bridge.test.mjs, and headless Chromium (software WebGL2/WebGPU) against examples/web-hello?a11y-proof and examples/web-showcase. Not verified: live screen readers (VoiceOver, NVDA, JAWS, Orca), Safari or Firefox, real GPU drivers, real touch screens, or KHR_parallel_shader_compile; headless Chromium timings use software rendering and are not performance measurements.
Activity
brittianwarner commentedon Nov 11, 2026
Evidence at
29aacb6;runtime/web/a11y.rsandbridge.jsare unchanged in these paths on devc92e462(2026-11-11).Runtime::a11y_json()has nocfgand returns the JSONsyncA11yrenders. A headless test can therefore print it besideaccessibility_json(). This view has:focus_selected(true);role("status")andlabel("Synced 2 minutes ago"), whose two texts area11y_hidden();live_region(LiveRegion::Polite).The native tree, trimmed:
The web mirror:
The issue text doesn't spell out these points:
web_a11y_itemsreadsn.labelonly for containers, links, images, buttons and headings (a11y.rs:358-368,369-405,479-487), and for a descendant's part of a button or link name (a11y.rs:272-286). The native tree names a node of any role (a11y/node.rs:128-129). A row that gives a composite line one spoken name, by labelling the row and hiding its parts, leaves nothing in the mirror at all. That is worse than a missing role: the text is gone.El::live_regionand the status and alert roles set the native live state (a11y/node.rs:181-186). The mirror item has no field for it, andsyncA11ynever writesaria-live(bridge.js:305-378). Live text reaches the mirror only as a plain<p>.selected(node.rs:180). The web mirror has two plain buttons. Arole("menu")withrole("menuitem")children that is not a modal also mirrors as one plain<button>per item, with no menu.tabIndex = -1(bridge.js:320) andpointer-events:none(bridge.js:297).aria-expanded(bridge.js:346-349).img(bridge.js:326). The mirror's root isrole="document"(bridge.js:68).Two related bugs are in the same builder but are not about missing roles, so they are filed separately:
subtree_ends): Web mirror: while a child exits, its parent drops out of the mirror or swallows later siblings, and the mirror stays that way after the exit ends #592.El::modalempties the mirror: Web mirror: an openEl::modalempties the whole DOM accessibility mirror, the modal included #593.The two hidden editing proxies staying in the accessibility tree is #594.
Docs: PLAN says which parts are built and which are Target, and four …
Docs: the rune README describes the renderer, overlays, image decodin…
Docs: a Text input page with input methods and text services by platf…
brittianwarner commentedon Nov 11, 2026
One more role the mirror drops, from a downstream app:
tabpanel. Evidence at29aacb6. The result and lines are the same on deve9c851c(2026-11-11).The native tree has a named tab panel. The web mirror flattens the panel's children into the parent landmark and drops its name. An app has no way to wrap a subtree in a mirror element of its own, so tabs cannot point at a panel (
aria-controls), and a screen reader never hears that it entered "Day".Native, trimmed:
main > tab-list > tab "Day", tab "Week"; tab-panel "Day" > "Monday", "Tuesday".Web:
There is no item for
#0/main/panel, and both texts havemainas their parent ("a":0).Where:
container_tag(runtime/web/a11y.rs:107-121) is the only thing that makes a wrapping item. It maps ten roles (main, navigation, banner, contentinfo, region, article, complementary, list, listitem, figure). Any other role falls throughweb_a11y_items(a11y.rs:358), so its children join the nearest mapped ancestor.syncA11y(platform/web/bridge.js:305) writes a role only forimg.Suggested direction: add
tabpanel(andtablist,group,dialog) to the wrapping roles, asdiv[role]witharia-labelfrom the node's label. The tabs could then getaria-controlsfrom a key the app gives, andaria-selectedas noted above. With the full tree this issue proposes, this would come for free.Today the app builds the panel itself: a shadow root on the mirror's
mainholds arole="tabpanel"element around a slot for the mirror's nodes, andreferenceTargetpointsmain's id at it. That only works in Chromium.pascalandr commentedon Nov 22, 2026
Additional reproduction at
21e5342b9a4cc33eeee88071b4b1f0eafb1247d4, using public Rune/rune-kit APIs (Rust 1.99.1, wasm-bindgen 0.2.130, headless Chromium 158.0.8127.18).Observed in the actual WASM DOM:
Button::disabled(true)becomes a button withdisabled=falseand noaria-disabled.Runtime::a11y_json()already loses those semantics before DOM encoding.Reproducer below: native prints both trees for closed/open states; a WASM build runs the same public kit components.
Browser checks after startup:
The container mapping is also related to #1344. Source observations:
roles.rshas no menu container mapping; the mirror's button classification depends on a press handler; its JSON/DOM path omits the disabled state.pascalandr commentedon Nov 22, 2026
Another case on Rune
21e5342b9a: the web mirror drops a namedtreeand a selectedtreeitemwith a separate row action. In a headlessRuntime, callcx.web_focus()in the view and return the following. Callframe(0.0)and compareaccessibility_json()witha11y_json():The native tree retains both rows under
Files. The web projection keepssrc, plain text formain.rs, and the Preview button separately. It also has nobusyfield: the native node builder maps.busy(true)to AccessKit, but the web item has no equivalent.Expected: preserve the named tree, both rows and their selected/expanded state, the separate Preview action, and map busy to
aria-busy. Thenested_pressguard suppresses the parenttreeitem, as it does the tab in #1344; keeping the row as a semantic container would avoid nesting buttons.Hona commentedon Nov 24, 2026
This is now complete on
devin #1965 (26ff632c9), building on earlier web mirror updates (#1583, #1737, #1752).What was built:
div[role]witharia-label) formenu,menubar,tree,treegrid,tabpanel,toolbar,grid,gridcell,rowgroup,form, andsearch(crates/rune/src/a11y/roles.rs,crates/rune/src/runtime/web/a11y.rs).aria-disabled="true"(without setting HTMLdisabled, so disabled controls stay discoverable and reject assistive presses) andaria-busy="true"across mirrored items and the canvasaria-activedescendantfocus proxy (crates/rune/src/platform/web/bridge.js), plusaria-levelandaria-expandedon tree items and expandable rows. Disabled controls withouton_press(such as disabledmenuitem,tab,checkbox,option,treeitem) now mirror instead of being dropped.sliderandspinbuttonrange controls witharia-label,aria-valuemin,aria-valuemax,aria-valuenow, andaria-valuetextin both the mirror and focus proxy.No new public Rust API is needed; existing
Elbuilders andrune-kitcontrols mirror automatically:Design note: Instead of replacing the mirror with full DOM-focus handoff onto mirror elements, this extends the existing DOM mirror and canvas
aria-activedescendantfocus proxy so Find-in-page and canvas keyboard routing keep working. If a real screen reader hits a case where the proxy is not enough, please reopen with details.Follows WAI-ARIA 1.2 role/state semantics and Rune's native AccessKit tree (
crates/rune/src/a11y/node.rs).Verified: headless Rust tests on Windows and macOS (
runea11y/runtime::web,rune-kita11y),wasm32WebGPU and WebGL2 builds,crates/rune/src/platform/web/bridge.test.mjs, and headless Chromium (software WebGL2/WebGPU) againstexamples/web-hello?a11y-proofandexamples/web-showcase.Not verified: live screen readers (VoiceOver, NVDA, JAWS, Orca), Safari or Firefox, real GPU drivers, real touch screens, or
KHR_parallel_shader_compile; headless Chromium timings use software rendering and are not performance measurements.