Skip to content

Commit

Permalink
fix: Allow role presentation and none on object-alt rule (#1224)
Browse files Browse the repository at this point in the history
This PR, allows role `presentation`/ `none` on `object`.

Closes issue: 
- #1221

## Reviewer checks

**Required fields, to be filled out by PR reviewer(s)**
- [x] Follows the commit message policy, appropriate for next version
- [x] Has documentation updated, a DU ticket, or requires no documentation change
- [x] Includes new tests, or was unnecessary
- [x] Code is reviewed for security by: @WilcoFiers
  • Loading branch information
jeeyyy authored and WilcoFiers committed Nov 7, 2018
1 parent 27fce9d commit d475a17
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/rules/object-alt.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
"has-visible-text",
"aria-label",
"aria-labelledby",
"non-empty-title"
"non-empty-title",
"role-presentation",
"role-none"
],
"none": []
}
2 changes: 2 additions & 0 deletions test/integration/rules/object-alt/object-alt.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<object id="pass3" aria-label="this object has text"></object>
<span id="label1">this object has text</span>
<object id="pass4" aria-labelledby="label1"></object>
<object id="pass5" role='presentation'></object>
<object id="pass6" role='none'></object>
<object id="violation1"></object>
<object id="violation2"><div> </div></object>
<object id="violation3"><p style="display: none;">This object has no text.</p></object>
2 changes: 1 addition & 1 deletion test/integration/rules/object-alt/object-alt.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"description": "object-alt tests",
"rule": "object-alt",
"violations": [["#violation1"], ["#violation2"], ["#violation3"]],
"passes": [["#pass1"], ["#pass2"], ["#pass3"], ["#pass4"]]
"passes": [["#pass1"], ["#pass2"], ["#pass3"], ["#pass4"], ["#pass5"], ["#pass6"]]
}

0 comments on commit d475a17

Please sign in to comment.