Skip to content

BUGFIX: template-require-media-caption — compare kind="captions" case-insensitively#2718

Merged
NullVoxPopuli merged 1 commit into
ember-cli:masterfrom
johanrd:fix/media-caption-case-insensitive
Apr 21, 2026
Merged

BUGFIX: template-require-media-caption — compare kind="captions" case-insensitively#2718
NullVoxPopuli merged 1 commit into
ember-cli:masterfrom
johanrd:fix/media-caption-case-insensitive

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.

Fix: lowercase the value before comparison.

Two new valid tests: <track kind="Captions">, <track kind="CAPTIONS">.

Prior art

Plugin Rule Reference
jsx-a11y media-has-caption Lowercases via String.prototype.toLowerCase() before comparison. Valid test <audio><track kind="Captions" /></audio> at __tests__/src/rules/media-has-caption-test.js:50.
vuejs-accessibility media-has-caption Same. Valid test <audio><track kind='Captions' /></audio> at src/rules/__tests__/media-has-caption.test.ts:17.

…sitively

HTML enumerated attribute values are case-insensitive per the spec:
https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#enumerated-attributes

Before: <track kind="Captions"> and kind="CAPTIONS" were treated as
missing a captions track.

Lowercase the value before comparison. Matches jsx-a11y and vue-a11y
(both lowercase before comparing).
@NullVoxPopuli NullVoxPopuli merged commit df5c01c into ember-cli:master Apr 21, 2026
10 checks passed
johanrd added a commit to johanrd/eslint-plugin-ember that referenced this pull request Apr 21, 2026
…itively

HTML attribute value comparison is ASCII case-insensitive per spec, so
`aria-hidden="TRUE"` and `aria-hidden="True"` (and their mustache-string
equivalents) should be recognised as truthy. Mirrors the same case-
handling choice made in ember-cli#2718 for `kind="captions"`.

Tests cover `"TRUE"`, `"True"`, `{{"TRUE"}}`, `{{"True"}}`.
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