Refactoring: Pull all fullscreen code out of Document and into its own helper class
[WebKit-https.git] / LayoutTests / accessibility / aria-orientation.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../resources/js-test-pre.js"></script>
5 </head>
6 <body id="body">
7
8 <div>Implicit defaults</div>
9 <input type="range" id="slider">
10 <input id="combo" type="text" role="combobox" placeholder="Placeholder" value="text">
11 <div id="listbox" role="listbox">
12     <div id="option1" role="option" aria-selected="true">Option</div>
13 </div>
14 <div id="menu" role="menu">
15     <div role="menuitem" id="item1" tabindex="0">Menu item 1</div>
16 </div>
17 <div id="menubar" role="menubar">menubar</div>
18 <div role="radiogroup" id="radiogroup">
19     <div role="radio" aria-label="radio 1" aria-checked="false">radio 1</div>
20 </div>
21 <div role="separator" id="separator"></div>
22 <div role="tablist" id="tablist">
23 <div role="toolbar" id="toolbar" aria-label="test toolbar"><li>item one</div>
24 <ul id="tree" role="tree">
25     <li id="treeitem1" role="treeitem">tree item</li>
26 </ul>
27 <table id="treegrid" role="treegrid">
28 <tbody>
29     <tr><td role="gridcell" colspan="3">cell</tr>
30     <tr><td role="gridcell" colspan="3">cell2</tr>
31 </tbody>
32 </table>
33
34 <br>
35 <div>Authored orientation</div>
36 <div role="radiogroup" id="radiogroup2" aria-orientation="vertical">
37     <div role="radio" aria-label="radio 1" aria-checked=false>radio 1</div>
38 </div>
39 <table id="treegrid2" role="treegrid" aria-orientation="horizontal">
40 <tbody>
41     <tr><td role="gridcell" colspan="3">cell</tr>
42     <tr><td role="gridcell" colspan="3">cell2</tr>
43 </tbody>
44 </table>
45 <div role="separator" id="separator2" aria-orientation="undefined"></div>
46 <span role="slider" id="slider2" aria-orientation="undefined" aria-valuenow=5 aria-valuemin=0 aria-valuemax=10>X</span>
47 <div role="listbox" id="listbox2" aria-orientation="horizontal">
48     <div id="option2" role="option" aria-selected="true">Option</div>
49 </div>
50
51 <p id="description"></p>
52 <div id="console"></div>
53
54 <script>
55
56     description("This test makes sure that aria-orientation works correctly and the implicit defaults are defined on different roles.");
57
58     if (window.accessibilityController) {
59           // Test implicit defaults on some roles.
60           var slider = accessibilityController.accessibleElementById("slider");
61           shouldBe("slider.orientation", "'AXOrientation: AXHorizontalOrientation'");
62           
63           var combobox = accessibilityController.accessibleElementById("combo");
64           shouldBe("combobox.orientation", "'AXOrientation: AXUnknownOrientation'");
65           
66           var listbox = accessibilityController.accessibleElementById("listbox");
67           shouldBe("listbox.orientation", "'AXOrientation: AXVerticalOrientation'");
68           
69           var menu = accessibilityController.accessibleElementById("menu");
70           shouldBe("menu.orientation", "'AXOrientation: AXVerticalOrientation'");
71           
72           var menubar = accessibilityController.accessibleElementById("menubar");
73           shouldBe("menubar.orientation", "'AXOrientation: AXHorizontalOrientation'");
74
75           var radiogroup = accessibilityController.accessibleElementById("radiogroup");
76           shouldBe("radiogroup.orientation", "'AXOrientation: AXUnknownOrientation'");
77
78           var separator = accessibilityController.accessibleElementById("separator");
79           shouldBe("separator.orientation", "'AXOrientation: AXHorizontalOrientation'");
80           
81           var tablist = accessibilityController.accessibleElementById("tablist");
82           shouldBe("tablist.orientation", "'AXOrientation: AXHorizontalOrientation'");
83           
84           var toolbar = accessibilityController.accessibleElementById("toolbar");
85           shouldBe("toolbar.orientation", "'AXOrientation: AXHorizontalOrientation'");
86           
87           var tree = accessibilityController.accessibleElementById("tree");
88           shouldBe("tree.orientation", "'AXOrientation: AXVerticalOrientation'");
89
90           var treegrid = accessibilityController.accessibleElementById("treegrid");
91           shouldBe("treegrid.orientation", "'AXOrientation: AXUnknownOrientation'");
92           
93           // Test authored aria-orientation are correct.
94           var radiogroup2 = accessibilityController.accessibleElementById("radiogroup2");
95           shouldBe("radiogroup2.orientation", "'AXOrientation: AXVerticalOrientation'");
96           
97           var treegrid2 = accessibilityController.accessibleElementById("treegrid2");
98           shouldBe("treegrid2.orientation", "'AXOrientation: AXHorizontalOrientation'");
99
100           var separator2 = accessibilityController.accessibleElementById("separator2");
101           shouldBe("separator2.orientation", "'AXOrientation: AXUnknownOrientation'");
102           
103           var slider2 = accessibilityController.accessibleElementById("slider2");
104           shouldBe("slider2.orientation", "'AXOrientation: AXUnknownOrientation'");
105
106           var listbox2 = accessibilityController.accessibleElementById("listbox2");
107           shouldBe("listbox2.orientation", "'AXOrientation: AXHorizontalOrientation'");
108     }
109
110 </script>
111
112 <script src="../resources/js-test-post.js"></script>
113 </body>
114 </html>