Skip to content

refactor(template-require-presentational-children): source role list from aria-query#2722

Merged
NullVoxPopuli merged 3 commits intoember-cli:masterfrom
johanrd:refactor/presentational-children-from-aria-query
Apr 21, 2026
Merged

refactor(template-require-presentational-children): source role list from aria-query#2722
NullVoxPopuli merged 3 commits intoember-cli:masterfrom
johanrd:refactor/presentational-children-from-aria-query

Conversation

@johanrd
Copy link
Copy Markdown
Contributor

@johanrd johanrd commented Apr 21, 2026

This PR is part of a broader a11y parity audit comparing our rules against jsx-a11y, vue-a11y, angular-eslint-template, and lit-a11y.

Replaces the hand-maintained list of 14 roles that require presentational children with a derivation from aria-query:

const { roles } = require('aria-query');
const ROLES_REQUIRING_PRESENTATIONAL_CHILDREN = new Set(
  [...roles.keys()].filter((role) => roles.get(role).childrenPresentational)
);

Before/after

Before After
Roles covered 14 (WAI-ARIA core) 16 (adds doc-pagebreak, graphics-symbol)

aria-query's childrenPresentational flag is set on the 16 roles that the WAI-ARIA 1.2 §5.2.9 + DPUB-ARIA 1.1 + Graphics-ARIA 1.0 specs mark with the Children Presentational rule.

Behavior expansion — DPUB / Graphics-ARIA

This PR adds two roles beyond WAI-ARIA core. Anyone using role="doc-pagebreak" or role="graphics-symbol" with semantic descendants will now see new warnings:

{{! Previously silently accepted, now flagged: }}
<div role="doc-pagebreak"><h2>pg</h2></div>
<div role="graphics-symbol"><text>X</text></div>

These are correct per the specs — both roles are defined to have presentational children — but the expansion is worth flagging for projects that consume DPUB-ARIA or Graphics-ARIA.

Follow-up note

template-no-invalid-role on master still carries a hand-maintained WAI-ARIA-only list — it will flag role="doc-pagebreak" as invalid. #2729 (currently open) addresses that: once merged, template-no-invalid-role will source its role set from aria-query too, and the two rules will agree on DPUB/Graphics-ARIA recognition.

Spec reference

johanrd added 3 commits April 21, 2026 08:48
…from aria-query

Replaces a hand-maintained list of 14 roles with a derivation from
aria-query's role.childrenPresentational flag.

Coverage grows from 14 to 16 roles — aria-query also includes
doc-pagebreak (DPUB-ARIA) and graphics-symbol (Graphics-ARIA), both
of which spec-require presentational children. Previously those would
have been silently accepted.

Spec: WAI-ARIA 1.2 — Children Presentational
https://www.w3.org/TR/wai-aria-1.2/#childrenArePresentational
@NullVoxPopuli NullVoxPopuli merged commit 787ddc4 into ember-cli:master Apr 21, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants