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

Role Changes to Support section 9.1 of ARIA spec #40071

Merged
merged 10 commits into from
May 19, 2023
35 changes: 35 additions & 0 deletions wai-aria/role/abstract-roles.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<!doctype html>
<html>
<head>
<title>Abstract Role Verification Tests</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<script src="/resources/testdriver-actions.js"></script>
<script src="/wai-aria/scripts/aria-utils.js"></script>
</head>
<body>


<p>Verifies <a href="https://w3c.github.io/aria/#document-handling_author-errors_roles">9.1 Roles - handling author errors</a></p>
cookiecrook marked this conversation as resolved.
Show resolved Hide resolved
<nav role="command" data-testname="command role" data-expectedrole="navigation" class="ex">x</nav>
<nav role="composite" data-testname="composite role" data-expectedrole="navigation" class="ex">x</nav>
<nav role="input" data-testname="input role" data-expectedrole="navigation" class="ex">x</nav>
<nav role="landmark" data-testname="landmark role" data-expectedrole="navigation" class="ex">x</nav>
<nav role="range" data-testname="range role" data-expectedrole="navigation" class="ex">x</nav>
<nav role="roletype" data-testname="roletype role" data-expectedrole="navigation" class="ex">x</nav>
<nav role="section" data-testname="section role" data-expectedrole="navigation" class="ex">x</nav>
<nav role="sectionhead" data-testname="sectionhead role" data-expectedrole="navigation" class="ex">x</nav>
<nav role="select" data-testname="select role" data-expectedrole="navigation" class="ex">x</nav>
<nav role="structure" data-testname="structure role" data-expectedrole="navigation" class="ex">x</nav>
<nav role="widget" data-testname="widget role" data-expectedrole="navigation" class="ex">x</nav>
<nav role="window" data-testname="window role" data-expectedrole="navigation" class="ex">x</nav>


<script>
AriaUtils.verifyRolesBySelector(".ex");
</script>

</body>
</html>
2 changes: 0 additions & 2 deletions wai-aria/role/basic.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@
<div id='d' style='height: 100px; width: 100px' role="group" aria-label="test label"></div>
<h1 id="h">test heading</h1>
<script>

promise_test(async t => {
const role = await test_driver.get_computed_role(document.getElementById('d'));
jnurthen marked this conversation as resolved.
Show resolved Hide resolved
assert_equals(role, "group");
}, "tests explicit role");


promise_test(async t => {
const role = await test_driver.get_computed_role(document.getElementById('h'));
assert_equals(role, "heading");
Expand Down
24 changes: 24 additions & 0 deletions wai-aria/role/fallback-roles.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!doctype html>
<html>
<head>
<title>Fallback Role Verification Tests</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<script src="/resources/testdriver-actions.js"></script>
<script src="/wai-aria/scripts/aria-utils.js"></script>
</head>
<body>

<p>Verifies Fallback Roles from <a href="https://w3c.github.io/aria/#document-handling_author-errors_roles">9.1 Roles - handling author errors</a></p>

<navigation role="region group" data-testname="fallback role w/ region with no label" data-expectedrole="group" class="ex">x</nav>
<navigation role="region group" data-testname="fallback role w/ region with label" aria-label="x" data-expectedrole="region" class="ex">x</nav>

<script>
AriaUtils.verifyRolesBySelector(".ex");
</script>

</body>
</html>
28 changes: 28 additions & 0 deletions wai-aria/role/form-roles.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!doctype html>
<html>
<head>
<title>Form Role Verification Tests</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<script src="/resources/testdriver-actions.js"></script>
<script src="/wai-aria/scripts/aria-utils.js"></script>
</head>
<body>

<p>Verifies <a href="https://w3c.github.io/aria/#document-handling_author-errors_roles">9.1 Roles - handling author errors</a></p>
jnurthen marked this conversation as resolved.
Show resolved Hide resolved


<!-- no label -->
<nav role="form" data-testname="form without label" data-expectedrole="navigation" class="ex">x</nav>

<!-- w/ label -->
<nav role="form" data-testname="form with label" data-expectedrole="form" aria-label="x" class="ex">x</nav>

<script>
AriaUtils.verifyRolesBySelector(".ex");
</script>

</body>
</html>
24 changes: 24 additions & 0 deletions wai-aria/role/invalid-roles.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!doctype html>
<html>
<head>
<title>Invalid Role Verification Tests</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<script src="/resources/testdriver-actions.js"></script>
<script src="/wai-aria/scripts/aria-utils.js"></script>
</head>
<body>

<p>Verifies Invalid Roles from <a href="https://w3c.github.io/aria/#document-handling_author-errors_roles">9.1 Roles - handling author errors</a></p>

<nav role="foo" data-testname="invalid role name foo" data-expectedrole="navigation" class="ex">x</nav>
<nav role="foo bar" data-testname="multiple invalid role names" data-expectedrole="navigation" class="ex">x</nav>

jnurthen marked this conversation as resolved.
Show resolved Hide resolved
<script>
AriaUtils.verifyRolesBySelector(".ex");
</script>

</body>
</html>
2 changes: 1 addition & 1 deletion wai-aria/role/roles.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"emphasis",
"feed",
"figure",
"form",
// form -> ./form-roles.html
"generic",
// graphics-* roles -> /graphics-aria
// "grid" -> ./grid-roles.html
Expand Down