Skip to content

Commit 9896115

Browse files
committed
test: add interactive-roles util test + document progressbar divergence
Covers the full util surface: - Canonical widget roles (button, link, combobox, etc.) — in set - Composite-widget containers (listbox, grid, tablist, tree, treegrid) — in set - toolbar manual override — in set (documented exception) - tooltip exclusion — NOT in set (WAI-ARIA 1.2 §5.3.3) - progressbar included (documented divergence from lit-a11y) - Set-size pin (35 roles) — surfaces aria-query taxonomy drift as test failure - COMPOSITE_WIDGET_CHILDREN sanity (listbox/option, grid/gridcell transitivity, treegrid/row+treeitem superClass inheritance, radiogroup/radio, submenu) Also extend the util JSDoc to document progressbar inclusion vs lit-a11y's readonly-value-based exclusion — previously only noted in the PR body.
1 parent 02516ec commit 9896115

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

lib/utils/interactive-roles.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,25 @@ const { roles } = require('aria-query');
55
// peer-plugin behavior here):
66
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/src/util/isInteractiveRole.js
77
//
8+
// Authority: aria-query widget taxonomy, one manual addition, one manual
9+
// exclusion. Both documented below.
10+
//
811
// `toolbar` is added explicitly — it does not descend from `widget` per
9-
// aria-query's taxonomy, but supports `aria-activedescendant` and is widget-
10-
// like in practice. jsx-a11y adds it for the same reason.
12+
// aria-query's taxonomy (its superClass is structure-based), but supports
13+
// `aria-activedescendant` and is widget-like in practice per WAI-ARIA APG's
14+
// toolbar pattern. jsx-a11y adds it for the same reason.
1115
//
1216
// `tooltip` is intentionally NOT added. Per WAI-ARIA 1.2 §5.3.3 — Document
1317
// Structure Roles (https://www.w3.org/TR/wai-aria-1.2/#tooltip), tooltip is
1418
// a document-structure role, not a widget; the spec says "document structures
1519
// are not usually interactive." jsx-a11y agrees.
20+
//
21+
// `progressbar` IS included (it descends from widget → range per aria-query).
22+
// lit-a11y explicitly excludes it on the grounds that `progressbar.value` is
23+
// always readonly, so the role isn't operable by the user. This is a real
24+
// design disagreement; we side with aria-query's taxonomy (and jsx-a11y) to
25+
// keep the authority single-sourced. Authors wanting lit-a11y behavior can
26+
// layer a rule-level exclusion if needed.
1627
module.exports.INTERACTIVE_ROLES = buildInteractiveRoleSet();
1728

1829
// Composite-widget child map — for each composite-widget parent role, the

0 commit comments

Comments
 (0)