Support ARIA "tab" roles
[WebKit-https.git] / LayoutTests / accessibility / aria-tab-roles.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 <ul id="tablist_1" role="tablist">
13 <li id="tab_1" role="tab" tabindex="0" class="">Crust</li>
14 <li id="tab_2" role="tab" tabindex="0" class="">Veges</li>
15 </ul>
16
17 <div id="panel_1" role="tabpanel" aria-labelledby="tab_1" >
18 <h3>Select Crust</h3>
19 </div>
20
21
22 <p id="description"></p>
23 <div id="console"></div>
24
25 <script>
26
27     description("This tests that the aria roles for tab, tabpanel and tablist work as expected correctly.");
28
29     if (window.accessibilityController) {
30
31           var body = document.getElementById("body");
32           body.focus();
33
34           var tabList = accessibilityController.focusedElement.childAtIndex(0);
35           var tab1 = tabList.childAtIndex(0);
36           var tab2 = tabList.childAtIndex(1);
37           var tabPanel = accessibilityController.focusedElement.childAtIndex(1);
38
39           shouldBe("tabList.role", "'AXRole: AXTabGroup'");
40           shouldBe("tab1.role", "'AXRole: AXRadioButton'");
41           shouldBe("tab1.title", "'AXTitle: Crust'");
42           shouldBe("tab1.childrenCount", "0");
43           shouldBe("tab2.role", "'AXRole: AXRadioButton'");
44           shouldBe("tab2.title", "'AXTitle: Veges'");
45           shouldBe("tabPanel.role", "'AXRole: AXGroup'");
46           shouldBe("tabPanel.subrole", "'AXSubrole: AXTabPanel'");
47     }
48
49     successfullyParsed = true;
50 </script>
51
52 <script src="../fast/js/resources/js-test-post.js"></script>
53 </body>
54 </html>