summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html-aam/roles-contextual.html
blob: 200fed7e75329b266118b69b2f092395960ff4bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<!doctype html>
<html>
<head>
  <title>HTML-AAM Contextual-Specific 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>Tests contextual computedrole mappings defined in <a href="https://w3c.github.io/html-aam/">HTML-AAM</a>, where the returned computed role is expected to change based on the context. Most test names correspond to a unique ID defined in the spec.<p>

<p>These should remain in alphabetical order.</code></p>


<!-- el-a -->
<a href="#" data-testname="el-a" data-expectedrole="link" class="ex">x</a>
<a data-testname="el-a-no-href" class="ex-generic">x</a>

<!-- el-aside -->
<aside data-testname="el-aside" data-expectedrole="complementary" class="ex">x</aside>
<main>
  <aside data-testname="el-aside-in-main" data-expectedrole="complementary" class="ex">x</aside>
  <article>
    <aside data-testname="el-aside-in-article-in-main" class="ex-generic">x</aside>
    <aside data-testname="el-aside-in-article-in-main-with-name" data-expectedrole="complementary" aria-label="x" class="ex">x</aside>
  </article>
</main>
<article>
  <aside data-testname="el-aside-in-article" class="ex-generic">x</aside>
  <aside data-testname="el-aside-in-article-with-name" data-expectedrole="complementary" aria-label="x" class="ex">x</aside>
</article>
<aside>
  <aside data-testname="el-aside-in-aside" class="ex-generic">x</aside>
  <aside data-testname="el-aside-in-aside-with-name" data-expectedrole="complementary" aria-label="x" class="ex">x</aside>
</aside>
<nav>
  <aside data-testname="el-aside-in-nav" class="ex-generic">x</aside>
  <aside data-testname="el-aside-in-nav-with-name" data-expectedrole="complementary" aria-label="x" class="ex">x</aside>
  <aside data-testname="el-aside-in-nav-with-role" data-expectedrole="complementary" class="ex" role="complementary">x</aside>
</nav>
<!-- Spec says that the conditional aside mapping happens when nested in a sectioning content element.
  However, this doesn't make sense if the parent <section> isn't a landmark in the first place.
  Let's force the section to always be a landmark for now, but we should probably expand on this test
  case pending discussions in https://github.com/w3c/html-aam/pull/484 -->
<section aria-label="x">
  <aside data-testname="el-aside-in-section" class="ex-generic">x</aside>
  <aside data-testname="el-aside-in-section-with-name" data-expectedrole="complementary" aria-label="x" class="ex">x</aside>
</section>

<!-- el-footer -->
<nav>
  <footer data-testname="el-footer" aria-label="x" class="ex-generic">x</aside>
</nav>
<footer data-testname="el-footer-ancestorbody" data-expectedrole="contentinfo" class="ex">x</footer>

<!-- el-header -->
<nav>
  <header data-testname="el-header" aria-label="x" class="ex-generic">x</header>
</nav>
<header data-testname="el-header-ancestorbody" data-expectedrole="banner" class="ex">x</header>
<main>
  <header data-testname="el-header-ancestormain" data-expectedrole="generic" class="ex-generic">x</header>
</main>

<!-- el-section -->
<section data-testname="el-section" aria-label="x" data-expectedrole="region" class="ex">x</section>
<section data-testname="el-section-no-name" class="ex-generic">x</section>


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

</body>
</html>