-
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.
add test cases for li and update rule logic #1301
- Loading branch information
Showing
5 changed files
with
261 additions
and
13 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
234 changes: 234 additions & 0 deletions
234
...r-engine/test/v2/checker/accessibility/rules/aria_semantics_role_ruleunit/li_element.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,234 @@ | ||
<!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" id="id-32"> | ||
|
||
<head id="id-29"> | ||
<title id="id-36">Li Element</title> | ||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> | ||
</head> | ||
|
||
<body id="id-9" aria-atomic="true"> | ||
<ul> | ||
<li> normal use of an li element</li> | ||
</ul> | ||
|
||
<ul> | ||
<li role="listitem"> redundant use of role 'listitem'</li> | ||
</ul> | ||
|
||
<ul role='none'> | ||
<li role="button">allowed because ul is no longer a 'list'</li> | ||
</ul> | ||
|
||
<ul role='menu'> | ||
<li role='button'>not allowed due to violation of menu hierarchy</button> | ||
</ul> | ||
|
||
<div role='tablist'> | ||
<ul role='presentation'> | ||
<li role=button>not allowed due to violation of tablist hierarchy</li> | ||
</ul> | ||
</div> | ||
|
||
<article> | ||
<li role='note'>allowed, li is not part of list and article role doesn't have a hierarchy restraint</li> | ||
</article> | ||
|
||
<script type="text/javascript"> | ||
UnitTest = { | ||
ruleIds: ["aria_semantics_role" ], | ||
results: [ | ||
{ | ||
"ruleId": "aria_semantics_role", | ||
"value": [ | ||
"INFORMATION", | ||
"PASS" | ||
], | ||
"path": { | ||
"dom": "/html[1]/body[1]/ul[2]/li[1]", | ||
"aria": "/document[1]/generic[1]/list[2]/listitem[1]" | ||
}, | ||
"reasonId": "Pass_0", | ||
"message": "Rule Passed", | ||
"messageArgs": [ | ||
"listitem", | ||
"li" | ||
], | ||
"apiArgs": [], | ||
"category": "Accessibility" | ||
}, | ||
{ | ||
"ruleId": "aria_semantics_role", | ||
"value": [ | ||
"INFORMATION", | ||
"PASS" | ||
], | ||
"path": { | ||
"dom": "/html[1]/body[1]/ul[3]", | ||
"aria": "/document[1]/generic[1]" | ||
}, | ||
"reasonId": "Pass_0", | ||
"message": "Rule Passed", | ||
"messageArgs": [ | ||
"none", | ||
"ul" | ||
], | ||
"apiArgs": [], | ||
"category": "Accessibility" | ||
}, | ||
{ | ||
"ruleId": "aria_semantics_role", | ||
"value": [ | ||
"INFORMATION", | ||
"PASS" | ||
], | ||
"path": { | ||
"dom": "/html[1]/body[1]/ul[3]/li[1]", | ||
"aria": "/document[1]/generic[1]/button[1]" | ||
}, | ||
"reasonId": "Pass_0", | ||
"message": "Rule Passed", | ||
"messageArgs": [ | ||
"button", | ||
"li" | ||
], | ||
"apiArgs": [], | ||
"category": "Accessibility" | ||
}, | ||
{ | ||
"ruleId": "aria_semantics_role", | ||
"value": [ | ||
"INFORMATION", | ||
"PASS" | ||
], | ||
"path": { | ||
"dom": "/html[1]/body[1]/ul[4]", | ||
"aria": "/document[1]/generic[1]/menu[1]" | ||
}, | ||
"reasonId": "Pass_0", | ||
"message": "Rule Passed", | ||
"messageArgs": [ | ||
"menu", | ||
"ul" | ||
], | ||
"apiArgs": [], | ||
"category": "Accessibility" | ||
}, | ||
{ | ||
"ruleId": "aria_semantics_role", | ||
"value": [ | ||
"INFORMATION", | ||
"PASS" | ||
], | ||
"path": { | ||
"dom": "/html[1]/body[1]/ul[4]/li[1]", | ||
"aria": "/document[1]/generic[1]/menu[1]/button[1]" | ||
}, | ||
"reasonId": "Pass_0", | ||
"message": "Rule Passed", | ||
"messageArgs": [ | ||
"button", | ||
"li" | ||
], | ||
"apiArgs": [], | ||
"category": "Accessibility" | ||
}, | ||
{ | ||
"ruleId": "aria_semantics_role", | ||
"value": [ | ||
"INFORMATION", | ||
"PASS" | ||
], | ||
"path": { | ||
"dom": "/html[1]/body[1]/div[1]", | ||
"aria": "/document[1]/generic[1]/tablist[1]" | ||
}, | ||
"reasonId": "Pass_0", | ||
"message": "Rule Passed", | ||
"messageArgs": [ | ||
"tablist", | ||
"div" | ||
], | ||
"apiArgs": [], | ||
"category": "Accessibility" | ||
}, | ||
{ | ||
"ruleId": "aria_semantics_role", | ||
"value": [ | ||
"INFORMATION", | ||
"PASS" | ||
], | ||
"path": { | ||
"dom": "/html[1]/body[1]/div[1]/ul[1]", | ||
"aria": "/document[1]/generic[1]/tablist[1]" | ||
}, | ||
"reasonId": "Pass_0", | ||
"message": "Rule Passed", | ||
"messageArgs": [ | ||
"presentation", | ||
"ul" | ||
], | ||
"apiArgs": [], | ||
"category": "Accessibility" | ||
}, | ||
{ | ||
"ruleId": "aria_semantics_role", | ||
"value": [ | ||
"INFORMATION", | ||
"PASS" | ||
], | ||
"path": { | ||
"dom": "/html[1]/body[1]/div[1]/ul[1]/li[1]", | ||
"aria": "/document[1]/generic[1]/tablist[1]/button[1]" | ||
}, | ||
"reasonId": "Pass_0", | ||
"message": "Rule Passed", | ||
"messageArgs": [ | ||
"button", | ||
"li" | ||
], | ||
"apiArgs": [], | ||
"category": "Accessibility" | ||
}, | ||
{ | ||
"ruleId": "aria_semantics_role", | ||
"value": [ | ||
"INFORMATION", | ||
"PASS" | ||
], | ||
"path": { | ||
"dom": "/html[1]/body[1]/article[1]/li[1]", | ||
"aria": "/document[1]/generic[1]/article[1]/note[1]" | ||
}, | ||
"reasonId": "Pass_0", | ||
"message": "Rule Passed", | ||
"messageArgs": [ | ||
"note", | ||
"li" | ||
], | ||
"apiArgs": [], | ||
"category": "Accessibility" | ||
} | ||
] | ||
} | ||
</script> | ||
</body> | ||
|
||
</html> |