-
Notifications
You must be signed in to change notification settings - Fork 791
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(role-text): add role-text rule (#2702)
* feat(role-text): add role-text rule * fix tests * fix
- Loading branch information
Showing
11 changed files
with
69 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"id": "aria-text", | ||
"selector": "[role=text]", | ||
"tags": ["cat.aria", "best-practice"], | ||
"metadata": { | ||
"description": "Ensures \"role=text\" is used on elements with no focusable descendants", | ||
"help": "\"role=text\" should have no focusable descendants" | ||
}, | ||
"all": [], | ||
"any": ["no-focusable-content"], | ||
"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
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
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,22 @@ | ||
<h1> | ||
<span role="text" id="pass1" | ||
>Digital accessibility, <br /> | ||
for everyone. | ||
</span> | ||
</h1> | ||
<a href="#" | ||
><span role="text" id="pass2">Buy <strong>t-shirts</strong> now</span></a | ||
> | ||
<div role="text" id="pass3">Some text<span> and some more text</span></div> | ||
|
||
<div role="text" id="fail1"> | ||
Still an <a href="#">interactive link</a> because of the author error. | ||
</div> | ||
<div role="text" id="fail2"> | ||
<a href="#" role="none">Flattened text</a> because of the explicit role. | ||
</div> | ||
<div role="text" id="fail3"> | ||
<a href="#" tabindex="-1" role="none">Flattened text</a> because of the | ||
explicit role. | ||
</div> | ||
<p role="text" id="fail4"><button>Hello</button></p> |
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,6 @@ | ||
{ | ||
"description": "aria-text tests", | ||
"rule": "aria-text", | ||
"violations": [["#fail1"], ["#fail2"], ["#fail3"], ["#fail4"]], | ||
"passes": [["#pass1"], ["#pass2"], ["#pass3"]] | ||
} |