Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(engine): Update ARIA definition for the ARIA in HTML changes #1802

Merged
merged 8 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions accessibility-checker-engine/src/v2/aria/ARIADefinitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1754,7 +1754,7 @@ export class ARIADefinitions {
},
"aside": {
implicitRole: ["complementary"],
validRoles: ["doc-dedication", "doc-example", "doc-footnote", "doc-pullquote", "doc-tip", "feed", "none", "note", "presentation", "region", "search"],
validRoles: ["doc-dedication", "doc-example", "doc-footnote", "doc-glossary", "doc-pullquote", "doc-tip", "feed", "none", "note", "presentation", "region", "search"],
globalAriaAttributesValid: true
},
"audio": {
Expand Down Expand Up @@ -2120,10 +2120,10 @@ export class ARIADefinitions {
globalAriaAttributesValid: true
},
"s": {
implicitRole: null,
implicitRole: ["deletion"],
validRoles: ["any"],
globalAriaAttributesValid: true,
prohibitedAriaAttributesWhenNoImplicitRole: ["aria-label", "aria-labelledby"]
otherDisallowedAriaAttributes: ["aria-label", "aria-labelledby"]
},
"samp": {
implicitRole: ["generic"],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<!DOCTYPE html>
<!--
/******************************************************************************
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>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>element role deletion</title>
</head>
<body>

<p><s aria-label="delet">There will be 15 tickets available at the box office tonight.</s></p>
<p><s role='alert' aria-label="delet">Tickets are sold out quickly, buy soon.</s></p>

<p>Please Check Later!</p>

<script>
UnitTest = {
ruleIds: ["aria_attribute_valid"],
results: [
{
"ruleId": "aria_attribute_valid",
"value": [
"INFORMATION",
"FAIL"
],
"path": {
"dom": "/html[1]/body[1]/p[1]/s[1]",
"aria": "/document[1]/paragraph[1]/deletion[1]"
},
"reasonId": "Fail_invalid_implicit_role_attr",
"message": "The ARIA attributes \"aria-label\" are not valid for the element <s> with implicit ARIA role \"deletion\"",
"messageArgs": [
"aria-label",
"s",
"deletion"
],
"apiArgs": [],
"category": "Accessibility"
},
{
"ruleId": "aria_attribute_valid",
"value": [
"INFORMATION",
"FAIL"
],
"path": {
"dom": "/html[1]/body[1]/p[2]/s[1]",
"aria": "/document[1]/paragraph[2]/alert[1]"
},
"reasonId": "Fail_invalid_role_attr",
"message": "The ARIA attributes \"aria-label\" are not valid for the element <s> with ARIA role \"alert\"",
"messageArgs": [
"aria-label",
"s",
"alert"
],
"apiArgs": [],
"category": "Accessibility"
}
]
}
</script>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<!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">Test aside aria role allowance</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
</head>

<body id="id-9" aria-atomic="true">
<aside id="id-6" role='doc-glossary' aria-expanded="true">
<h4>Epcot Center</h4>
<p>The Epcot Center is a theme park in Disney World, Florida.</p>
</aside>

<script type="text/javascript">
UnitTest = {
ruleIds: ["aria_role_valid", "aria-attribute_valid"],
results: [
{
"ruleId": "aria_role_valid",
"value": [
"INFORMATION",
"PASS"
],
"path": {
"dom": "/html[1]/body[1]/aside[1]",
"aria": "/document[1]/generic[1]/doc-glossary[1]"
},
"reasonId": "Pass_0",
"message": "Rule Passed",
"messageArgs": [
"doc-glossary",
"aside"
],
"apiArgs": [],
"category": "Accessibility"
}
]
}
</script>

</body>

</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<!DOCTYPE html>
<!--
/******************************************************************************
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>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>element role deletion</title>
</head>
<body>

<p><s role="deletion">There will be 15 tickets available at the box office tonight.</s></p>

<p>Please Check Later!</p>

<script>
UnitTest = {
ruleIds: ["aria_role_redundant"],
results: [
{
"ruleId": "aria_role_redundant",
"value": [
"INFORMATION",
"FAIL"
],
"path": {
"dom": "/html[1]/body[1]/p[1]/s[1]",
"aria": "/document[1]/paragraph[1]/deletion[1]"
},
"reasonId": "fail_redundant",
"message": "The explicitly-assigned ARIA role \"deletion\" is redundant with the implicit role of the element <s>",
"messageArgs": [
"deletion",
"s"
],
"apiArgs": [],
"category": "Accessibility"
}
]
}
</script>
</body>
</html>