-
Notifications
You must be signed in to change notification settings - Fork 83
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 #1848 from IBMa/dev-1610
fixrule(`element_tabbable_visible`): Reduce "Needs review" on custom checkbox and radio buttons
- Loading branch information
Showing
9 changed files
with
213 additions
and
15 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
90 changes: 90 additions & 0 deletions
90
.../v2/checker/accessibility/rules/element_tabbable_visible_ruleunit/Checkbox-clip-zero.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,90 @@ | ||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | ||
|
||
<!-- | ||
/****************************************************************************** | ||
Copyright:: 2020- IBM, Inc | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*****************************************************************************/ | ||
--> | ||
|
||
<html lang="en"> | ||
|
||
<head> | ||
<title>Test Example</title> | ||
<style> | ||
.catalog--checkbox { | ||
position: absolute; | ||
width: 1px; | ||
height: 1px; | ||
margin: -1px; | ||
padding: 0; | ||
overflow: hidden; | ||
white-space: nowrap; | ||
border: 1px; | ||
visibility: inherit; | ||
clip: rect(0,0,0,0); | ||
display: block; | ||
|
||
} | ||
|
||
.catalog--checkbox-label-text::before { | ||
position: absolute; | ||
top: 0.125rem; | ||
left: 0; | ||
width: 1rem; | ||
height: 1rem; | ||
border: 1px solid var(--cds-icon-01, #161616); | ||
margin: 0.125rem 0.125rem 0.125rem 0.1875rem; | ||
background-color: rgba(0,0,0,0); | ||
border-radius: 1px; | ||
display:block; | ||
content: ""; | ||
} | ||
|
||
</style> | ||
</head> | ||
|
||
<body> | ||
|
||
<div> | ||
<input type="checkbox" class="catalog--checkbox" id="catalog"> | ||
<label for="catalog" class="catalog--checkbox-label-text">iOS</label> | ||
</div> | ||
<script> | ||
UnitTest = { | ||
ruleIds: ["element_tabbable_visible"], | ||
results: [ | ||
{ | ||
"ruleId": "element_tabbable_visible", | ||
"value": [ | ||
"INFORMATION", | ||
"PASS" | ||
], | ||
"path": { | ||
"dom": "/html[1]/body[1]/div[1]/input[1]", | ||
"aria": "/document[1]/checkbox[1]" | ||
}, | ||
"reasonId": "pass", | ||
"message": "The tabbable element is visible on the screen", | ||
"messageArgs": [], | ||
"apiArgs": [], | ||
"category": "Accessibility" | ||
} | ||
] | ||
} | ||
</script> | ||
|
||
</body> | ||
|
||
</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
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
84 changes: 84 additions & 0 deletions
84
...est/v2/checker/accessibility/rules/element_tabbable_visible_ruleunit/Radio-clip-zero.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,84 @@ | ||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | ||
|
||
<!-- | ||
/****************************************************************************** | ||
Copyright:: 2020- IBM, Inc | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*****************************************************************************/ | ||
--> | ||
|
||
<html lang="en"> | ||
|
||
<head> | ||
<title>Test Example</title> | ||
<style> | ||
.catalog--radio { | ||
position: absolute; | ||
width: 1px; | ||
height: 1px; | ||
margin: -1px; | ||
padding: 0; | ||
overflow: hidden; | ||
clip: rect(0, 0, 0, 0); | ||
border: 0; | ||
|
||
} | ||
|
||
.catalog--radio-label-text { | ||
flex: auto; | ||
background-color: #FFF; | ||
color: #1E69A6; | ||
text-align: center; | ||
padding: 4px 8px; | ||
border: 1px solid #999CA0; | ||
border-radius: 0; | ||
transition: all 0.2s ease-in-out; | ||
} | ||
|
||
</style> | ||
</head> | ||
|
||
<body> | ||
|
||
<div> | ||
<input type="radio" class="catalog--radio" id="catalog"> | ||
<label for="catalog" class="catalog--radio-label-text">iOS</label> | ||
</div> | ||
<script> | ||
UnitTest = { | ||
ruleIds: ["element_tabbable_visible"], | ||
results: [ | ||
{ | ||
"ruleId": "element_tabbable_visible", | ||
"value": [ | ||
"INFORMATION", | ||
"PASS" | ||
], | ||
"path": { | ||
"dom": "/html[1]/body[1]/div[1]/input[1]", | ||
"aria": "/document[1]/radio[1]" | ||
}, | ||
"reasonId": "pass", | ||
"message": "The tabbable element is visible on the screen", | ||
"messageArgs": [], | ||
"apiArgs": [], | ||
"category": "Accessibility" | ||
} | ||
] | ||
} | ||
</script> | ||
|
||
</body> | ||
|
||
</html> |