Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: role=radio should not require aria-checked #1448

Merged
merged 3 commits into from
Apr 5, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/commons/aria/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1550,9 +1550,9 @@ lookupTable.role = {
'aria-posinset',
'aria-setsize',
'aria-required',
'aria-errormessage'
],
required: ['aria-checked']
'aria-errormessage',
'aria-checked'
]
},
owned: null,
nameFrom: ['author', 'contents'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
<div role="spinbutton" id="pass3" aria-valuenow="value" aria-valuemax="value" aria-valuemin="value">ok</div>
<div role="heading" id="pass4" aria-level="1">ok</div>
<div role="combobox" id="pass5" aria-expanded="true">ok</div>
<span role="radio" id="pass6">I am BLUE!</span>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a check to show it doesn't fail when you give it aria-checked please.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... in the rule that checks allowed attributes.

<span role="radio" id="pass7" aria-checked="false">I am RED!</span>
<span role="radio" id="pass8" aria-checked="true">I am GREEN!</span>

<div role="scrollbar" id="violation1">fail</div>
<div role="slider" id="violation2">fail</div>
Expand Down
11 changes: 10 additions & 1 deletion test/integration/rules/aria-required-attr/required-attr.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,14 @@
["#violation4"],
["#violation5"]
],
"passes": [["#pass1"], ["#pass2"], ["#pass3"], ["#pass4"], ["#pass5"]]
"passes": [
["#pass1"],
["#pass2"],
["#pass3"],
["#pass4"],
["#pass5"],
["#pass6"],
["#pass7"],
["#pass8"]
]
}