WAI-ARIA: checkbox does not determine its label from text content
[WebKit-https.git] / LayoutTests / accessibility / aria-checkbox-text.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <link rel="stylesheet" href="../fast/js/resources/js-test-style.css">
5 <script>
6 var successfullyParsed = false;
7 </script>
8 <script src="../fast/js/resources/js-test-pre.js"></script>
9 </head>
10 <body id="body">
11
12 <div role="radiobuttongroup">
13         <div role="checkbox" id="check1" tabindex="0" aria-checked="true">One</div>
14         <div role="checkbox" id="check2" tabindex="0">Two</div>
15         <div role="checkbox" id="check3" tabindex="0" id="foo" aria-labelledby="foo">Three</div>
16 </div>
17
18 <p id="description"></p>
19 <div id="console"></div>
20
21 <script>
22
23     description("This tests that ARIA checkboxes use accessible name computation.");
24
25     if (window.accessibilityController) {
26
27           var checkbox = document.getElementById("check1");
28           checkbox.focus();
29           checkbox = accessibilityController.focusedElement;
30           shouldBe("checkbox.title", "'AXTitle: One'");
31
32           checkbox = document.getElementById("check2");
33           checkbox.focus();
34           checkbox = accessibilityController.focusedElement;
35           shouldBe("checkbox.title", "'AXTitle: Two'");
36
37           checkbox = document.getElementById("check3");
38           checkbox.focus();
39           checkbox = accessibilityController.focusedElement;
40           shouldBe("checkbox.title", "'AXTitle: Three'");
41     }
42
43     successfullyParsed = true;
44 </script>
45
46 <script src="../fast/js/resources/js-test-post.js"></script>
47 </body>
48 </html>