Skip to content

Commit

Permalink
Merge pull request #1442 from IBMa/dev-1336
Browse files Browse the repository at this point in the history
Sync dev branch dev-1336 to dev-1304
  • Loading branch information
shunguoy authored May 11, 2023
2 parents 3daecbe + cef6c8b commit 4a66b6e
Show file tree
Hide file tree
Showing 3 changed files with 221 additions and 0 deletions.
6 changes: 6 additions & 0 deletions accessibility-checker-engine/src/v2/aria/ARIADefinitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1710,6 +1710,7 @@ export class ARIADefinitions {
"body": {
implicitRole: ["generic"],
validRoles: null,
otherDisallowedAriaAttributes: ['aria-hidden'],
globalAriaAttributesValid: true
},
"br": {
Expand Down Expand Up @@ -2051,6 +2052,11 @@ export class ARIADefinitions {
validRoles: null,
globalAriaAttributesValid: false
},
"search": {
implicitRole: ['search'],
validRoles: ['search', 'form', 'group', 'none', 'presentation', 'region'],
globalAriaAttributesValid: true
},
"slot": {
implicitRole: null,
validRoles: null,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>Sandbox</title>
<meta charset="UTF-8" />
</head>

<body aria-hidden="true">
<main>
<h1>Test page</h1>
</main>
<script>
UnitTest = {
ruleIds: ["aria_attribute_allowed"],
results: [
{
"ruleId": "aria_attribute_allowed",
"value": [
"INFORMATION",
"FAIL"
],
"path": {
"dom": "/html[1]/body[1]",
"aria": "/document[1]/generic[1]"
},
"reasonId": "Fail_invalid_implicit_role_attr",
"message": "The ARIA attributes \"aria-hidden\" are not valid for the element <body> with implicit ARIA role \"generic\"",
"messageArgs": [
"aria-hidden",
"body",
"generic"
],
"apiArgs": [],
"category": "Accessibility"
}
]
};
</script>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>Sandbox</title>
<meta charset="UTF-8" />
</head>

<body>
<main>
<search>
<label for=s>Site</label>
<input type=search id=s>
<button>Go!</button>
</search>
<search role="search" aria-checked="true"> </search>
<search role="alert" > </search>
<search role="form" aria-atomic="true"> </search>
</main>
<script>
UnitTest = {
ruleIds: ["aria_attribute_allowed", "aria_semantics_role", "aria_role_redundant"],
results: [
{
"ruleId": "aria_role_redundant",
"value": [
"INFORMATION",
"FAIL"
],
"path": {
"dom": "/html[1]/body[1]/main[1]/search[2]",
"aria": "/document[1]/main[1]/search[2]"
},
"reasonId": "fail_redundant",
"message": "The explicitly-assigned ARIA role \"search\" is redundant with the implicit role of the element <search>",
"messageArgs": [
"search",
"search"
],
"apiArgs": [],
"category": "Accessibility"
},
{
"ruleId": "aria_semantics_role",
"value": [
"INFORMATION",
"PASS"
],
"path": {
"dom": "/html[1]/body[1]/main[1]/search[2]",
"aria": "/document[1]/main[1]/search[2]"
},
"reasonId": "Pass_0",
"message": "Rule Passed",
"messageArgs": [
"search",
"search"
],
"apiArgs": [],
"category": "Accessibility"
},
{
"ruleId": "aria_attribute_allowed",
"value": [
"INFORMATION",
"FAIL"
],
"path": {
"dom": "/html[1]/body[1]/main[1]/search[2]",
"aria": "/document[1]/main[1]/search[2]"
},
"reasonId": "Fail_invalid_role_attr",
"message": "The ARIA attributes \"aria-checked\" are not valid for the element <search> with ARIA role \"search\"",
"messageArgs": [
"aria-checked",
"search",
"search"
],
"apiArgs": [],
"category": "Accessibility"
},
{
"ruleId": "aria_role_redundant",
"value": [
"INFORMATION",
"PASS"
],
"path": {
"dom": "/html[1]/body[1]/main[1]/search[3]",
"aria": "/document[1]/main[1]/alert[1]"
},
"reasonId": "pass",
"message": "An explicitly-assigned ARIA role is not redundant with the implicit role of the element",
"messageArgs": [],
"apiArgs": [],
"category": "Accessibility"
},
{
"ruleId": "aria_semantics_role",
"value": [
"INFORMATION",
"FAIL"
],
"path": {
"dom": "/html[1]/body[1]/main[1]/search[3]",
"aria": "/document[1]/main[1]/alert[1]"
},
"reasonId": "Fail_1",
"message": "The ARIA role 'alert' is not valid for the element <search>",
"messageArgs": [
"alert",
"search"
],
"apiArgs": [],
"category": "Accessibility"
},
{
"ruleId": "aria_role_redundant",
"value": [
"INFORMATION",
"PASS"
],
"path": {
"dom": "/html[1]/body[1]/main[1]/search[4]",
"aria": "/document[1]/main[1]/form[1]"
},
"reasonId": "pass",
"message": "An explicitly-assigned ARIA role is not redundant with the implicit role of the element",
"messageArgs": [],
"apiArgs": [],
"category": "Accessibility"
},
{
"ruleId": "aria_semantics_role",
"value": [
"INFORMATION",
"PASS"
],
"path": {
"dom": "/html[1]/body[1]/main[1]/search[4]",
"aria": "/document[1]/main[1]/form[1]"
},
"reasonId": "Pass_0",
"message": "Rule Passed",
"messageArgs": [
"form",
"search"
],
"apiArgs": [],
"category": "Accessibility"
},
{
"ruleId": "aria_attribute_allowed",
"value": [
"INFORMATION",
"PASS"
],
"path": {
"dom": "/html[1]/body[1]/main[1]/search[4]",
"aria": "/document[1]/main[1]/form[1]"
},
"reasonId": "Pass",
"message": "ARIA attributes are valid for the element and ARIA role",
"messageArgs": [
"aria-atomic",
"search",
"form"
],
"apiArgs": [],
"category": "Accessibility"
}
]
};
</script>
</body>
</html>

0 comments on commit 4a66b6e

Please sign in to comment.