Repository navigation
Done
Description
Context: we're doing preliminary work on porting Strata (lgse/strata) from GTK 4 to Rune. Its
list, icon and table views are virtual rows (virtual_rows) with section headings, tiles packed
several to a row, and table cells.
What's missing (5d421fd, unchanged at 29aacb6):
- Every mounted virtual row gets its list index as its position (
a11y/tree.rs:397), so a
heading among options reads as an item ("12 of 20"). - Nothing relates items to the heading above them (AccessKit's
member_of, ARIA
aria-owns), so a screen reader never hears the group it enters. El::position_in_set(i, n)on an item setsnas the size of set of the element holding it
(a11y/tree.rs:340, applied at:398), overriding the row's own place among the rows.- AccessKit has
row_count,column_count,row_indexandcolumn_index; noElbuilder
sets them, so "row 50,000 of 100,000, column C" can't be said.
Repro (headless; ran at 5d421fd and 2a44156):
use rune::{Cx, El, Env, GrowthSpec, Runtime, ScrollSpec, col, row, text};
fn grouped(_: &(), _: &mut Cx<()>) -> El {
col().size(300.0, 600.0).scroll(ScrollSpec { stick_bottom: false }).child(
col().key("list").role("listbox").label("Files").growth(GrowthSpec::default())
.virtual_rows(20, 24.0, |_: &(), i| format!("r{i}").into(), |_: &(), i| {
if i == 0 || i == 11 { text(format!("Group {i}")).h(24.0).role("heading") }
else { text(format!("Item {i}")).h(24.0).role("option") }
}))
}
fn grid(_: &(), _: &mut Cx<()>) -> El {
col().size(600.0, 300.0).scroll(ScrollSpec { stick_bottom: false }).child(
col().key("grid").role("grid").label("Icons").growth(GrowthSpec::default())
.virtual_rows(5, 30.0, |_: &(), i| format!("line{i}").into(), |_: &(), i| {
row().h(30.0).role("row").children((0..8).map(move |c| text(format!("tile {}", i * 8 + c)).role("gridcell").position_in_set(i * 8 + c + 1, 40)))
}))
}
fn show(name: &str, view: fn(&(), &mut Cx<()>) -> El, roles: &[&str]) {
let mut rt = Runtime::new((), view, (600.0, 600.0), Env::new(true, 1.0));
rt.frame(0.0);
rt.frame(0.016);
println!("{name}:");
let mut stack = vec![rt.accessibility_json()];
while let Some(mut n) = stack.pop() {
if let Some(kids) = n.get_mut("children").map(serde_json::Value::take) {
stack.extend(kids.as_array().into_iter().flatten().rev().cloned());
}
if n.get("role").and_then(|r| r.as_str()).is_some_and(|r| roles.contains(&r)) {
println!(" {} {} position {} setSize {}", n["role"], n["name"], n["position"], n["setSize"]);
}
}
}
fn main() {
show("headings among options", grouped, &["heading"]);
show("grid of rows of cells", grid, &["grid", "row"]);
}Output:
headings among options:
"heading" "Group 0" position 1 setSize null
"heading" "Group 11" position 12 setSize null
grid of rows of cells:
"grid" "Icons" position null setSize 5
"row" "tile 0 tile 1 tile 2 tile 3 tile 4 tile 5 tile 6 tile 7" position 1 setSize 40
"row" "tile 8 tile 9 tile 10 tile 11 tile 12 tile 13 tile 14 tile 15" position 2 setSize 40
"row" "tile 16 tile 17 tile 18 tile 19 tile 20 tile 21 tile 22 tile 23" position 3 setSize 40
"row" "tile 24 tile 25 tile 26 tile 27 tile 28 tile 29 tile 30 tile 31" position 4 setSize 40
"row" "tile 32 tile 33 tile 34 tile 35 tile 36 tile 37 tile 38 tile 39" position 5 setSize 40
Ask.
- A way for a virtual row to take no position and not count (a heading).
- An
Elbuilder naming the element (by key) a row belongs to. - Keep a container's size of set to its own set; give the items' size to the container as
a count of its children where its role has one. El::column_index(i),El::row_index(i), andEl::grid_size(rows, cols)(or counts on
gridandtable), mapped to AccessKit's.
Related: #111 (WCAG audit on desktop).
Metadata
Metadata
Assignees
Labels
No labels
Activity
osmelmora commentedon Nov 20, 2026
One more case for item 3, from a tree, and an AccessKit detail that affects the fix.
Use case. We're building headless widget behaviors on Rune core, outside rune-kit. Our tree is one focusable host over
virtual_rows, so its rows are one flat list withEl::levelon each. Rows at different levels belong to different sets. "Fruits" is 1 of 2, and its child "Apple" is 1 of 3. Each row says so withposition_in_set, but every size lands on the tree element, and the last mounted row's size wins. A reader hears every row as "of 2".Repro (headless; ran at
eff95e8ondev):Output:
AccessKit reads set size only from a container. So putting the size on each row wouldn't be enough by itself. The Windows and AT-SPI adapters report an item's set size as its nearest ancestor's (
size_of_set_from_container,accesskit_consumer0.39.2src/node.rs:633). They call it fromvendor/accesskit_windows/src/node.rs:692andaccesskit_atspi_common0.21.1src/node.rs:401, and never read the item's ownsize_of_set. AccessKit'smainis the same, and its macOS adapter reports no set size at all.So per-level sizes in a flat tree need one of these:
size_of_setbefore its container's, and Rune keeps the size on the item.Until then our tree reports per-level set size as unsupported.
Hona commentedon Nov 24, 2026
Landed the parts settled by the WAI-ARIA 1.2 specification and Chromium's accessibility tree in #1798 (
e565a1eondev), and leaving this issue open for the two design items below.Under WAI-ARIA 1.2 (
aria-posinset,aria-setsize,aria-rowcount,aria-colcount,aria-rowindex,aria-colindex) and Chromium (ui/accessibility/ax_role_properties.ccIsItemLike/IsSetLike/IsTableLike,ui/accessibility/ax_node.ccIsOrderedSetItem,ui/accessibility/ax_tree.ccComputeSetSizePosInSetAndCache), headings and other non-item roles never receive set positions,grid/table/row/gridcelluse row/column counts and indices rather than set sizes, and a container's set size tracks its shallowest hierarchical level.Done in #1798 (
e565a1e):virtual_rowsnow auto-assignsposition_in_setonly to ordered-set item roles (listitem,option,treeitem,menuitem*,tab,radio,article, androwinside an ordered-set container), soheadingrows take no position. SettingEl::position_in_set(pos, total_items)on the items sets both their positions and the container'ssize_of_set, excluding headings.set_sizescoping (item 3, grid/row & top-level tree):El::position_in_setnow propagatessize_of_setonly to ordered-set containers (neverrow,grid,table, orwindow), and deeperlevelitems in a flattreeno longer overwrite the top level's set size on the tree node.El::row_count,El::column_count,El::row_index, andEl::column_index(1-based onElandaccessibility_json'srowCount/columnCount/rowIndex/columnIndex, 0-based on AccessKitNode). Avirtual_rowscontainer with rolegridortablepopulatesrow_countand rowrow_indexinstead ofsize_of_set/position_in_setunless overridden. Note that AccessKit 0.25.2's platform adapters do not yet exposerow_count/column_count/row_index/column_indexto UIA/AT-SPI/NSAccessibility; Rune populates the AccessKit nodes so adapters will pick them up once supported.Still open:
role="group"containers rather than linking options to headings (there is noaria-memberof), AccessKit 0.25.2's platform adapters ignoreNode::member_ofandNode::owns, and a key reference to a heading row breaks once the heading scrolls out of the mounted window. How Rune should model virtualized option groups remains an open design choice.tree(item 3 comment): as noted above,accesskit_consumer0.39.2 (size_of_set_from_container) readssize_of_setonly from ancestor containers and never from the item itself, so per-level set sizes on flattreeitemsiblings still need either upstream AccessKit support or synthetic nestedgroupnodes incrates/rune/src/a11y/tree.rs.Hona commentedon Nov 24, 2026
The set-size, heading-position, and grid index defects reported here are now fixed on
dev, and the remaining feature requests live in dedicated issues below:e565a1e): stoppedvirtual_rowsfrom assigningposition_in_setto non-item rows such as headings, keptEl::position_in_setfrom overwritingrow/grid/tablecontainers or shallower tree levels, and addedEl::row_count,El::column_count,El::row_index, andEl::column_index.8a54a0a): emittedsize_of_setdirectly on levelled ordered-set items (keeping flat trees flat with no synthetic groups), patchedvendor/accesskit_windowsand vendoredvendor/accesskit_atspi_commonso Windows UIA and Linux AT-SPI read an item's ownsize_of_setbefore its container's without leaking counts onto containers (apps pinning this rev should addaccesskit_atspi_commonunder[patch.crates-io]for Linux; reported upstream in Allow item-level size_of_set to override container size_of_set for flat trees AccessKit/accesskit#875).These changes were verified with headless tree and adapter unit tests (and a Linux compile check); no live screen reader was run, and
accesskit_macosdoes not expose set sizes yet.What remains is tracked separately:
virtual_rows#1379 (nestedvirtual_rowsinsiderole="group"containers also works via Virtual lists: a list in a row of another windows against the same scroll viewport #956).El::owns: No setters formultiselectable,controls,haspopup,orientation,requiredorowns, so a multi-select list or a popup trigger can't be expressed #1159 (WAI-ARIA models grouped options withrole="group"rather thanaria-memberof).If any of the fixed cases still reproduce on current
dev, please reopen with a repro on8a54a0aor later. Thanks for the detailed repros!