Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <title>HTML select control tests</title>
5 <link rel="stylesheet" type="text/css"
6 href="chrome://mochikit/content/tests/SimpleTest/test.css" />
8 <script type="application/javascript"
9 src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
11 <script type="application/javascript"
12 src="../common.js"></script>
13 <script type="application/javascript"
14 src="../role.js"></script>
16 <script type="application/javascript">
17 function doTest()
18 {
19 var accTree = {
20 role: ROLE_LISTBOX,
21 children: [
22 {
23 role: ROLE_GROUPING,
24 children: [
25 {
26 role: ROLE_STATICTEXT,
27 children: [ ]
28 },
29 {
30 role: ROLE_OPTION,
31 children: [
32 {
33 role: ROLE_TEXT_LEAF
34 }
35 ]
36 },
37 {
38 role: ROLE_OPTION,
39 children: [
40 {
41 role: ROLE_TEXT_LEAF
42 }
43 ]
44 }
45 ]
46 },
47 {
48 role: ROLE_OPTION,
49 children: [
50 {
51 role: ROLE_TEXT_LEAF
52 }
53 ]
54 }
55 ]
56 };
57 testAccessibleTree("listbox", accTree);
59 accTree = {
60 role: ROLE_COMBOBOX,
61 children: [
62 {
63 role: ROLE_COMBOBOX_LIST,
64 children: [
65 {
66 role: ROLE_GROUPING,
67 children: [
68 {
69 role: ROLE_STATICTEXT,
70 children: [ ]
71 },
72 {
73 role: ROLE_COMBOBOX_OPTION,
74 children: [
75 {
76 role: ROLE_TEXT_LEAF
77 }
78 ]
79 },
80 {
81 role: ROLE_COMBOBOX_OPTION,
82 children: [
83 {
84 role: ROLE_TEXT_LEAF
85 }
86 ]
87 },
88 ]
89 },
90 {
91 role: ROLE_COMBOBOX_OPTION,
92 children: [
93 {
94 role: ROLE_TEXT_LEAF
95 }
96 ]
97 }
98 ]
99 }
100 ]
101 };
102 testAccessibleTree("combobox", accTree);
104 SimpleTest.finish();
105 }
107 SimpleTest.waitForExplicitFinish();
108 addA11yLoadEvent(doTest);
109 </script>
110 </head>
111 <body>
113 <a target="_blank"
114 title="remove all the code in #ifdef COMBO_BOX_WITH_THREE_CHILDREN"
115 href="https://bugzilla.mozilla.org/show_bug.cgi?id=506616">
116 Mozilla Bug 506616
117 </a>
118 <p id="display"></p>
119 <div id="content" style="display: none"></div>
120 <pre id="test">
121 </pre>
123 <select id="listbox" size="4">
124 <optgroup label="Colors">
125 <option>Red</option>
126 <option>Blue</option>
127 </optgroup>
128 <option>Animal</option>
129 </select>
131 <select id="combobox">
132 <optgroup label="Colors">
133 <option>Red</option>
134 <option>Blue</option>
135 </optgroup>
136 <option>Animal</option>
137 </select>
138 </body>
139 </html>