Skip to content

BUGFIX: template-no-aria-unsupported-elements — source the reserved-element list from aria-query#2719

Merged
NullVoxPopuli merged 2 commits into
ember-cli:masterfrom
johanrd:fix/aria-unsupported-extend-to-dom-reserved
Apr 21, 2026
Merged

BUGFIX: template-no-aria-unsupported-elements — source the reserved-element list from aria-query#2719
NullVoxPopuli merged 2 commits into
ember-cli:masterfrom
johanrd:fix/aria-unsupported-extend-to-dom-reserved

Conversation

@johanrd
Copy link
Copy Markdown
Contributor

@johanrd johanrd commented Apr 21, 2026

This PR is part of a Phase 3 a11y-parity audit against jsx-a11y / vue-a11y / angular-eslint-template / lit-a11y.

  • Premise: The HTML-AAM spec enumerates elements whose documentation conformance forbids or restricts ARIA attributes. aria-query encodes a closely-related list in dom[tag].reserved.
  • Problem: Our rule hand-maintained a shorter set (8 elements) and silently accepted ARIA attributes on <col>, <colgroup>, <noembed>, <noscript>, <param>, <picture>, <source>, and <track>.

Fix: derive the set from aria-query's dom map by filtering def.reserved.

Before After
Elements flagged meta, html, script, style, title, base, head, link (8) same + col, colgroup, noembed, noscript, param, picture, source, track (16)

aria-query is already a dependency — no new packages. Six new invalid tests cover the previously-missing elements.

Caveat — aria-query .reserved vs HTML-AAM docconformance list

These sets are close but not identical:

  • HTML-AAM lists map, slot, template as "No role or aria-*" — aria-query does NOT include these in .reserved. This PR does not close those gaps.
  • aria-query includes html, picture in .reserved — HTML-AAM's wording for these is softer ("No role other than document or generic..." for html; "authors MAY specify aria-hidden..." for picture). aria-query's "reserved" flag is stricter than the spec text.
  • title, track, noembed are in aria-query's .reserved set; their HTML-AAM status is less clearly documented in the main conformance table.

Using aria-query's .reserved set is a pragmatic approximation of the HTML-AAM list, not an exact mirror.

Prior art

Verified each peer in source:

Plugin Rule Mechanism
jsx-a11y aria-unsupported-elements Uses aria-query's dom map filtered by .reserved. Tests iterate dom.keys().filter(el => dom.get(el).reserved).
vuejs-accessibility aria-unsupported-elements Same — line 25: (dom.get(getElementType(node)) || {}).reserved.
lit-a11y aria-unsupported-elements Hardcoded list ['meta', 'script', 'style'] at line 16; does not consult aria-query.
@angular-eslint/template No equivalent rule.

johanrd added 2 commits April 21, 2026 07:40
…ist from aria-query

The rule's hand-maintained set covered 8 elements:
  meta, html, script, style, title, base, head, link

aria-query's dom map marks 16 elements as reserved (its source is
HTML-AAM §2, which lists every element that must not have ARIA):
  base, col, colgroup, head, html, link, meta, noembed, noscript,
  param, picture, script, source, style, title, track

Replace the hand-list with a filtered view of aria-query's dom map.
aria-query is already a dependency (used elsewhere for role/attribute
validation). No new dependency, no behavioural regression — the new set
is a superset of the old one.

Six new invalid tests cover the previously-missing elements: col,
colgroup, noscript, picture, source, track.
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