Repository navigation
fix(a11y): scope virtual set positions to item roles and add grid row/column counts and indices - #1798
Merged
Conversation
…/column counts and indices
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.
Refs #533
Root cause
crates/rune/src/a11y/tree.rsassigned every mountedvirtual_rowschild its raw list index asposition_in_setregardless of role, so headings inside a virtual list read as numbered items (including file headers inDiffView).a11y_walkcopied any descendant'sEl::position_in_setsize unconditionally onto its parent slot, lettinggridcellitems overwrite arownode'ssize_of_setand letting deepertreeitemlevels overwrite a flattree's top-level set size.Elhad no builders for ARIAaria-rowcount,aria-colcount,aria-rowindex, oraria-colindex, andvirtual_rowson agridortableexposedsize_of_set/position_in_setinstead ofrow_count/row_index.Changes
crates/rune/src/a11y/roles.rs: addedordered_set,ordered_set_item_in, andtable_containermatching WAI-ARIA 1.2 and Chromium'sui::IsSetLike,ui::IsItemLike,AXNode::IsOrderedSetItem, andui::IsTableLike.crates/rune/src/a11y/tree.rs:position_in_setinvirtual_rowsonly for ordered-set item roles (omittingheading,group,splitter,gridcell,cell, etc.).El::position_in_set's set size only to ordered-set containers (neverrow,grid,table, orwindow), keeping the shallowest hierarchical level's size on the container.row_countonvirtual_rowsgrid/tablecontainers androw_indexon theirrowchildren (explicit builders override), and includevirtual_rowslengths and table counts/indices in fingerprints anda11y_scrolled.crates/rune/src/el/a11y.rs,crates/rune/src/a11y/node.rs,crates/rune/src/a11y/dump.rs: addedEl::row_count,El::column_count,El::row_index, andEl::column_index(1-based onEland JSONrowCount/columnCount/rowIndex/columnIndex, 0-based on AccessKitNode).crates/rune-kit/tests/a11y/golden/diff.json: removed the erroneousposition: 1on theheadingrowdf0.crates/rune/src/a11y/tree_tests.rs: regression tests for headings invirtual_rows, non-setrowand flat-treeset_sizeprotection, and grid counts/indices including incremental updates.Left open on #533
role="group"containers rather than linking items to headings, has noaria-memberof, and AccessKit 0.25.2's platform adapters do not yet readNode::member_oforNode::owns.accesskit_consumer::Node::size_of_set_from_container) readssize_of_setonly from ancestor containers, not from individual items.Verification
cargo test -p rune -p rune-mermaid -p rune-kit --features rune-kit/markdown,rune-kit/mermaid a11y(77 passed inrune, 2 inrune-kitlib) andcargo test -p rune-kit --features rune-kit/markdown,rune-kit/mermaid --test a11y(25 passed).scripts/file-size.sh(0 errors).row_count/column_count/row_index/column_indexto UIA/AT-SPI/NSAccessibility).