summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/wai-aria/role/listbox-roles.html
blob: 50208229278d4f49e0651d4e3e18a10d457d16a8 (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
<!doctype html>
<html>
<head>
    <title>Listbox-related 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 <a href="https://w3c.github.io/aria/#listbox">listbox</a> and related roles.</p>

<div role="listbox" data-testname="div role is listbox" data-expectedrole="listbox" class="ex">
    <div role="option" data-testname="role is option (in div listbox)" data-expectedrole="option" class="ex">x</div>
    <div role="group" data-testname="role is group (in div listbox)" data-expectedrole="group" class="ex">
        <span role="option" data-testname="role is option (in group, in div listbox)" data-expectedrole="option" class="ex">x</span>
        <span role="option">x</span>
    </div>
    <div role="option">x</div>
</div>

<ul role="listbox" data-testname="ul role is listbox" data-expectedrole="listbox" class="ex">
    <li role="option" data-testname="li role is option (in ul listbox)" data-expectedrole="option" class="ex">
        x
    </li>
    <li role="option">
        x
    </li>
</ul>

<nav role="option" data-testname="orphaned option outside the context of listbox" data-expectedrole="navigation"
     class="ex">x
</nav>

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

</body>
</html>