Skip to content

fix(web): preserve status/alert roles, live regions, radiogroup containers, and named progressbars in the accessibility mirror - #1737

Merged
Hona merged 1 commit into
devfrom
fix/1677-web-a11y-status-live
Nov 23, 2026
Merged

Hona merged 1 commit into
devfrom
fix/1677-web-a11y-status-live

Conversation

@Hona

@Hona Hona commented Nov 23, 2026

Copy link
Copy Markdown
Member

Fixes #1677

Root cause

  • crates/rune/src/a11y/roles.rs: radiogroup (and container forms of status, alert, and log) had no .aria_container() mapping, so web_a11y_items emitted child radio buttons without their named radiogroup container.
  • crates/rune/src/runtime/web/a11y.rs: A11yItem / web_a11y_items dropped status/alert/log roles, El::live_region politeness (aria-live), and named progressbar elements with range_value / a11y_value.
  • crates/rune/src/platform/web/bridge.js: syncA11y only wrote role on group and button items, ignored aria-live and aria-value* attributes, and called replaceChildren() before setting textContent on plain-text updates.

Changes

  • crates/rune/src/a11y/roles.rs: mark radiogroup, status, alert, and log with .aria_container().
  • crates/rune/src/runtime/web/a11y.rs:
    • Add live ("lv"), range ("rg": [min, max, value]), and value_text ("vt") to A11yItem.
    • Preserve status/alert/log roles and effective live-region politeness (n.a11y.live.or_else(|| roles::default_live(n.role))) on text and container nodes (keeping empty live text mounted and excluding live text from inline/flow merging, while keeping secure/redacted text excluded).
    • Emit named progressbar items with role="progressbar", finite range_value, and a11y_value.
  • crates/rune/src/platform/web/bridge.js:
    • Map progressbar to a div with role="progressbar", aria-label, aria-valuemin, aria-valuemax, aria-valuenow, and aria-valuetext.
    • Apply role and aria-live on text and container mirror nodes, keeping keyed DOM node identity across updates and skipping textContent / replaceChildren() writes when unchanged.

Verification

  • cargo test -p rune -p rune-mermaid -p rune-kit --features rune-kit/markdown,rune-kit/mermaid -- a11y::roles runtime::web::a11y runtime::web::export (33 passed; new tests verified failing before the fix).
  • node --test crates/rune/src/platform/web/bridge.test.mjs (26 passed; new syncA11y tests verified failing before the fix).
  • cargo check-wasm and cargo check-webgl (both passed).
  • scripts/file-size.sh (0 errors).
  • Not checked on this machine: live browser / screen-reader session against a running WASM build.

…iners, and named progressbars in the accessibility mirror
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Web: preserve status roles and live-region settings in the accessibility mirror

1 participant