-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1964 from IBMa/dev-1911
fixrule(`element_scrollable_tabbable`, `label_name_visible`): fix issues related to off-screen and scrollable content
- Loading branch information
Showing
9 changed files
with
250 additions
and
5 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
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
46 changes: 46 additions & 0 deletions
46
...st/v2/checker/accessibility/rules/element_scrollable_tabbable_ruleunit/textarea_pass.html
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,46 @@ | ||
<!DOCTYPE html> | ||
<html lang="en-US"> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> | ||
<title>test case</title> | ||
</head> | ||
<body> | ||
<textarea style="height: 100px; width: 500px; overflow-y: scroll"> | ||
<h1>WCAG Abstract</h1> | ||
<p> | ||
Web Content Accessibility Guidelines (WCAG) covers a wide range of recommendations for making Web content more | ||
accessible. Following these guidelines will make content more accessible to a wider range of people with | ||
disabilities, including accommodations for blindness and low vision, deafness and hearing loss, limited movement, | ||
speech disabilities, photosensitivity, and combinations of these, and some accommodation for learning disabilities | ||
and cognitive limitations; but will not address every user need for people with these disabilities. These guidelines | ||
address accessibility of web content on desktops, laptops, tablets, and mobile devices. Following these guidelines | ||
will also often make Web content more usable to users in general. | ||
</p> | ||
</textarea> | ||
|
||
<script> | ||
UnitTest = { | ||
ruleIds: ["element_scrollable_tabbable"], | ||
results: [ | ||
{ | ||
"ruleId": "element_scrollable_tabbable", | ||
"value": [ | ||
"INFORMATION", | ||
"PASS" | ||
], | ||
"path": { | ||
"dom": "/html[1]/body[1]/textarea[1]", | ||
"aria": "/document[1]/textbox[1]" | ||
}, | ||
"reasonId": "pass_tabbable", | ||
"message": "The scrollable element is tabbable", | ||
"messageArgs": [], | ||
"apiArgs": [], | ||
"category": "Accessibility" | ||
} | ||
] | ||
} | ||
</script> | ||
</body> | ||
|
||
</html> |
40 changes: 40 additions & 0 deletions
40
...t/v2/checker/accessibility/rules/element_scrollable_tabbable_ruleunit/textarea_pass2.html
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,40 @@ | ||
<!DOCTYPE html> | ||
<html lang="en-US"> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> | ||
<title>test case</title> | ||
</head> | ||
<body> | ||
<textarea id="story" name="story" rows="1" cols="33"> | ||
It was a dark and stormy night... | ||
It was a dark and stormy night... | ||
It was a dark and stormy night... | ||
It was a dark and stormy night... | ||
</textarea> | ||
|
||
<script> | ||
UnitTest = { | ||
ruleIds: ["element_scrollable_tabbable"], | ||
results: [ | ||
{ | ||
"ruleId": "element_scrollable_tabbable", | ||
"value": [ | ||
"INFORMATION", | ||
"PASS" | ||
], | ||
"path": { | ||
"dom": "/html[1]/body[1]/textarea[1]", | ||
"aria": "/document[1]/textbox[1]" | ||
}, | ||
"reasonId": "pass_tabbable", | ||
"message": "The scrollable element is tabbable", | ||
"messageArgs": [], | ||
"apiArgs": [], | ||
"category": "Accessibility" | ||
} | ||
] | ||
} | ||
</script> | ||
</body> | ||
|
||
</html> |
44 changes: 44 additions & 0 deletions
44
.../v2/checker/accessibility/rules/label_name_visible_ruleunit/label_multiple_offscreen.html
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,44 @@ | ||
<!DOCTYPE html> | ||
<html lang="en-US"> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> | ||
<title>test case</title> | ||
</head> | ||
<body> | ||
<div role="button" id='button1' aria-label="Visible label"> | ||
<span style="position:absolute;left:-1000px">1st label</span> | ||
2nd label | ||
<span style="position:absolute;left:-1000px">3rd label</span> | ||
4th label | ||
<span>5th label</span>6th label | ||
<span style="position:absolute;left:-1000px">7th label</span> | ||
8th label | ||
</div> | ||
|
||
<div> another line </div> | ||
<script> | ||
UnitTest = { | ||
ruleIds: ["label_name_visible"], | ||
results: [ | ||
{ | ||
"ruleId": "label_name_visible", | ||
"value": [ | ||
"INFORMATION", | ||
"FAIL" | ||
], | ||
"path": { | ||
"dom": "/html[1]/body[1]/div[1]", | ||
"aria": "/document[1]/button[1]" | ||
}, | ||
"reasonId": "Fail_1", | ||
"message": "Accessible name does not match or contain the visible label text", | ||
"messageArgs": [], | ||
"apiArgs": [], | ||
"category": "Accessibility" | ||
} | ||
] | ||
} | ||
</script> | ||
</body> | ||
|
||
</html> |
59 changes: 59 additions & 0 deletions
59
...gine/test/v2/checker/accessibility/rules/label_name_visible_ruleunit/label_offscreen.html
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,59 @@ | ||
<!DOCTYPE html> | ||
<html lang="en-US"> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> | ||
<title>test case</title> | ||
</head> | ||
<body> | ||
<button id='button1' aria-label="Visible label"> | ||
<span style="position:absolute;left:-1000px">Offscreen content</span> | ||
Visible label | ||
</button> | ||
|
||
<button id='button2' aria-label="Another visible label"> | ||
<span> Another Offscreen content</span> | ||
Another Visible label | ||
</button> | ||
<div> another line </div> | ||
<script> | ||
UnitTest = { | ||
ruleIds: ["label_name_visible"], | ||
results: [ | ||
{ | ||
"ruleId": "label_name_visible", | ||
"value": [ | ||
"INFORMATION", | ||
"PASS" | ||
], | ||
"path": { | ||
"dom": "/html[1]/body[1]/button[1]", | ||
"aria": "/document[1]/button[1]" | ||
}, | ||
"reasonId": "Pass_0", | ||
"message": "Accessible name matches or contains the visible label text", | ||
"messageArgs": [], | ||
"apiArgs": [], | ||
"category": "Accessibility" | ||
}, | ||
{ | ||
"ruleId": "label_name_visible", | ||
"value": [ | ||
"INFORMATION", | ||
"FAIL" | ||
], | ||
"path": { | ||
"dom": "/html[1]/body[1]/button[2]", | ||
"aria": "/document[1]/button[2]" | ||
}, | ||
"reasonId": "Fail_1", | ||
"message": "Accessible name does not match or contain the visible label text", | ||
"messageArgs": [], | ||
"apiArgs": [], | ||
"category": "Accessibility" | ||
} | ||
] | ||
} | ||
</script> | ||
</body> | ||
|
||
</html> |