Skip to content

Commit

Permalink
Synonym role tests for wai-aria (web-platform-tests#38941)
Browse files Browse the repository at this point in the history
Asserts computedrole for ARIA Core-AAM role synonyms
 - image/img
 - none/presentation
 - list/directory

Related Issues:
 - web-platform-tests/interop-accessibility#10
 - w3c/core-aam#166

Supporting Spec Change:
 - w3c/core-aam#167

Implementation Changes:
 - WebKit: https://webkit.org/b/224617
 - Chromium: https://bugs.chromium.org/p/chromium/issues/detail?id=1428763

Reviewed By:
 - spectranaut: Valerie Young (Igalia)
  • Loading branch information
cookiecrook committed Apr 8, 2023
1 parent 6214926 commit 0213192
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions wai-aria/role/synonym-roles.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!doctype html>
<html>
<head>
<title>Region 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>

<!-- spec resolution https://github.com/w3c/core-aam/issues/166 -->

<div role="none" id="none" data-expectedrole="none" data-testname="none role == computedrole none" class="ex">x</div><!-- preferred -->
<div role="presentation" id="presentation" data-expectedrole="none" data-testname="synonym presentation role == computedrole none" class="ex">x</div><!-- synonym -->

<div role="image" id="image" data-expectedrole="image" data-testname="image role == computedrole image" class="ex">x</div><!-- preferred -->
<div role="img" id="img" data-expectedrole="image" data-testname="synonym img role == computedrole image" class="ex">x</div><!-- synonym -->

<!-- `directory` synonym deprecated in ARIA 1.2; these examples should all return computedrole `list` -->
<ul role="list" id="list2" data-expectedrole="list" data-testname="list role == computedrole list" class="ex"><li>x</li></ul>
<ul role="directory" id="directory" data-expectedrole="list" data-testname="directory role == computedrole list" class="ex"><li>x</li></ul>
<div role="directory" id="div" data-expectedrole="list" data-testname="div w/directory role == computedrole list" class="ex"><div role="listitem">x</div></div>

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

0 comments on commit 0213192

Please sign in to comment.