Skip to content

Commit

Permalink
fix(aria-allowed-roles): allow role=radio on img with non-empty name (#…
Browse files Browse the repository at this point in the history
…3320)

* adds role=radio to img alt=foo allowances

A `role=radio` was meant to be an allowance for an `img alt=foo`, but it had mistakenly been left out of the spec.
ARIA in HTML is fixing this oversight, w3c/html-aria#381, so this PR is to match this added allowance.

* odd whitespace fix

* Update html-elms.js

* add test for img element with valid role=radio

* Update aria-allowed-role.json
  • Loading branch information
scottaohara authored Dec 13, 2021
1 parent d497f40 commit accafdf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/standards/html-elms.js
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ const htmlElms = {
'menuitemradio',
'option',
'progressbar',
'radio',
'scrollbar',
'separator',
'slider',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,11 @@ <h1 id="pass-h1-valid-role" role="none"></h1>
aria-labelledby="image-baz"
id="pass-img-valid-role-aria-labelledby"
/>
<img
role="radio"
aria-label="test"
id="pass-img-valid-role-radio"
>
<img role="text" aria-label="foo" id="fail-img-invalid-role-aria-label" />
<img role="spinbutton" title="bar" id="fail-img-invalid-role-title" />
<img
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
["#pass-img-valid-role-aria-label"],
["#pass-img-valid-role-title"],
["#pass-img-valid-role-aria-labelledby"],
["#pass-img-valid-role-radio"],
["#pass-imgmap-1"],
["#pass-imgmap-2"]
],
Expand Down

0 comments on commit accafdf

Please sign in to comment.