Skip to content

fix(a11y): scope virtual set positions to item roles and add grid row/column counts and indices - #1798

Merged
Hona merged 1 commit into
devfrom
fix/533-a11y-lists-grids
Nov 24, 2026
Merged

Hona merged 1 commit into
devfrom
fix/533-a11y-lists-grids

Conversation

@Hona

@Hona Hona commented Nov 24, 2026

Copy link
Copy Markdown
Member

Refs #533

Root cause

  • crates/rune/src/a11y/tree.rs assigned every mounted virtual_rows child its raw list index as position_in_set regardless of role, so headings inside a virtual list read as numbered items (including file headers in DiffView).
  • a11y_walk copied any descendant's El::position_in_set size unconditionally onto its parent slot, letting gridcell items overwrite a row node's size_of_set and letting deeper treeitem levels overwrite a flat tree's top-level set size.
  • El had no builders for ARIA aria-rowcount, aria-colcount, aria-rowindex, or aria-colindex, and virtual_rows on a grid or table exposed size_of_set / position_in_set instead of row_count / row_index.

Changes

  • crates/rune/src/a11y/roles.rs: added ordered_set, ordered_set_item_in, and table_container matching WAI-ARIA 1.2 and Chromium's ui::IsSetLike, ui::IsItemLike, AXNode::IsOrderedSetItem, and ui::IsTableLike.
  • crates/rune/src/a11y/tree.rs:
    • Auto-assign position_in_set in virtual_rows only for ordered-set item roles (omitting heading, group, splitter, gridcell, cell, etc.).
    • Propagate El::position_in_set's set size only to ordered-set containers (never row, grid, table, or window), keeping the shallowest hierarchical level's size on the container.
    • Populate row_count on virtual_rows grid/table containers and row_index on their row children (explicit builders override), and include virtual_rows lengths and table counts/indices in fingerprints and a11y_scrolled.
  • crates/rune/src/el/a11y.rs, crates/rune/src/a11y/node.rs, crates/rune/src/a11y/dump.rs: added El::row_count, El::column_count, El::row_index, and El::column_index (1-based on El and JSON rowCount/columnCount/rowIndex/columnIndex, 0-based on AccessKit Node).
  • crates/rune-kit/tests/a11y/golden/diff.json: removed the erroneous position: 1 on the heading row df0.
  • crates/rune/src/a11y/tree_tests.rs: regression tests for headings in virtual_rows, non-set row and flat-tree set_size protection, and grid counts/indices including incremental updates.
col().key("sheet").role("grid").label("Files")
    .row_count(100_000)
    .column_count(5)
    .child(
        row().key("r50k").role("row").row_index(50_000)
            .child(text("Size").key("col-c").role("gridcell").row_index(50_000).column_index(3)),
    )

Left open on #533

  • Group membership across flat virtual rows: WAI-ARIA groups options inside role="group" containers rather than linking items to headings, has no aria-memberof, and AccessKit 0.25.2's platform adapters do not yet read Node::member_of or Node::owns.
  • Per-level set sizes in a flat native tree: AccessKit 0.25.2 (accesskit_consumer::Node::size_of_set_from_container) reads size_of_set only from ancestor containers, not from individual items.

Verification

  • Ran cargo test -p rune -p rune-mermaid -p rune-kit --features rune-kit/markdown,rune-kit/mermaid a11y (77 passed in rune, 2 in rune-kit lib) and cargo test -p rune-kit --features rune-kit/markdown,rune-kit/mermaid --test a11y (25 passed).
  • Ran scripts/file-size.sh (0 errors).
  • Not checked on this machine: live screen-reader announcements on Windows/macOS/Linux (note also that AccessKit 0.25.2's native adapters do not yet wire row_count/column_count/row_index/column_index to UIA/AT-SPI/NSAccessibility).

@Hona
Hona merged commit e565a1e into dev Nov 24, 2026
1 check passed
@Hona
Hona deleted the fix/533-a11y-lists-grids branch November 24, 2026 00:29
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.

1 participant