Repository navigation
Conversation
Headings now use the AXHeading role (NSAccessibilityHeadingRole, macOS 26) instead of the non-standard "Heading" string, and expose their level both as AXHeadingLevel (1-based) and as AXValue, as WebKit and Chromium do for older releases. Tables, grids and tree grids now expose AXRows (their rows, including rows inside row groups), AXRowCount, AXColumnCount and AXColumnHeaderUIElements; rows expose AXIndex; cells expose AXRowIndexRange and AXColumnIndexRange. Counts and indices come from the provider. When the provider gives none, AXRowCount falls back to the number of rows exposed and every other structural attribute is withheld through isAccessibilitySelectorAllowed: instead of being reported as 0.
|
Thanks for this. We have done the table side for a virtualised grid and aligned the heading part with yours ( |
|
Here is a VoiceOver result for the heading part, since the description says VoiceOver has not been run against this yet. We made the same two heading changes as this PR as a local patch on
Our app sets one-based levels, so We have not tested the table part of this PR. We found the heading problem while testing RDX, a remote-desktop app whose new interface is built on GPUI (Zed's UI framework, which drives AccessKit). Written with the help of an AI assistant from our test notes. The speech quoted came from VoiceOver. |
What
On macOS, headings and tables currently expose almost no structure:
Role::Headingmaps to the role string"Heading", which is not a standard AX role, and the node'slevelis never read.AXRows,AXRowCount,AXColumnCount,AXIndex, cell ranges or column headers (issue Computed table information #10 covers the related computed-table case).This PR:
Role::HeadingtoAXHeading(NSAccessibilityHeadingRole, macOS 26), and exposes the level asAXHeadingLevel(1-based) and asAXValue, as WebKit and Chromium do for releases before macOS 26;Table,GridandTreeGrid:AXRows(row children plus the rows insideRowGroupchildren),AXRowCount,AXColumnCountandAXColumnHeaderUIElements(theColumnHeadercells of its rows);AXIndex; for cells (Cell,GridCell,ColumnHeader,RowHeader):AXRowIndexRangeandAXColumnIndexRange.Counts and indices come only from the provider (
row_count,column_count,row_index,column_index, spans). When the provider gives none,AXRowCountfalls back to the number of rows exposed, and every other structural attribute is withheld throughisAccessibilitySelectorAllowed:rather than reported as 0.AXColumnsis not implemented (AppKit marks it optional), and neither are per-cell header links, since AccessKit has no property for them.accessibilityAttributeValue:now returnsNSObjectinstead ofNSString, so that it can return anNSNumberforAXHeadingLevel; the existing string attributes are unchanged.Testing
On macOS 27 (Apple silicon), with a winit host exposing a book chapter with four headings (levels 1, 2, 1, 2) and a 3 × 2 table with a header row, queried through
AXUIElement:Heading, role description "Heading", no level; table with noAXRowsor counts;AXHeading, description "heading",AXHeadingLevel1, 2, 1, 2;AXRowsholding exactly the 3 rows,AXRowCount3,AXColumnCount2, each row'sAXIndex, each cell's row and column range, andAXColumnHeaderUIElementsequal to the two header cells;cargo fmt --check,cargo clippy -p accesskit_macos --all-targets -- -D warningsandcargo test -p accesskit_macospass. The adapter has no unit tests to extend; I have not built with Rust 1.87 locally, and nothing here uses newer language or library features. VoiceOver itself has not yet been run against this build.