-
Notifications
You must be signed in to change notification settings - Fork 795
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(role-img-alt): Split rule for role=img with no accessible name (#…
- Loading branch information
1 parent
b9a324a
commit 2416ed3
Showing
7 changed files
with
48 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"id": "role-img-alt", | ||
"selector": "[role='img']:not(svg):not(img):not(area):not(input):not(object)", | ||
"tags": [ | ||
"cat.text-alternatives", | ||
"wcag2a", | ||
"wcag111", | ||
"section508", | ||
"section508.22.a" | ||
], | ||
"metadata": { | ||
"description": "Ensures [role='img'] elements have alternate text", | ||
"help": "[role='img'] elements have an alternative text" | ||
}, | ||
"all": [], | ||
"any": ["aria-label", "aria-labelledby", "non-empty-title"], | ||
"none": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<div id="match">Bananas</div> | ||
<div id="hidden-match" style="display:none">Banana bombs</div> | ||
|
||
<div role="img" aria-label="blah" id="pass1"></div> | ||
<div role="img" aria-labelledby="match" id="pass2"></div> | ||
<div role="img" aria-labelledby="hidden-match" id="pass3"></div> | ||
<div role="img" title="title" id="pass4"></div> | ||
|
||
<div role="img" id="violation1"></div> | ||
<div role="img" aria-label="" id="violation2"></div> | ||
<div role="img" alt="blah" id="violation3"></div> | ||
<div role="img" aria-labelledby="no-match" id="violation4"></div> | ||
<div role="img" title="" id="violation5"></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"description": "role-img-alt tests", | ||
"rule": "role-img-alt", | ||
"violations": [ | ||
["#violation1"], | ||
["#violation2"], | ||
["#violation3"], | ||
["#violation4"], | ||
["#violation5"] | ||
], | ||
"passes": [["#pass1"], ["#pass2"], ["#pass3"], ["#pass4"]] | ||
} |