|
1 <!DOCTYPE html> |
|
2 <html> |
|
3 |
|
4 <head> |
|
5 <title>HTML form controls tests</title> |
|
6 <link rel="stylesheet" type="text/css" |
|
7 href="chrome://mochikit/content/tests/SimpleTest/test.css" /> |
|
8 |
|
9 <script type="application/javascript" |
|
10 src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> |
|
11 |
|
12 <script type="application/javascript" |
|
13 src="../common.js"></script> |
|
14 <script type="application/javascript" |
|
15 src="../role.js"></script> |
|
16 |
|
17 <script type="application/javascript"> |
|
18 function doTest() |
|
19 { |
|
20 // input@type="checkbox" |
|
21 var accTree = { |
|
22 role: ROLE_CHECKBUTTON, |
|
23 children: [ ] |
|
24 }; |
|
25 |
|
26 testAccessibleTree("checkbox", accTree); |
|
27 |
|
28 // input@type="radio" |
|
29 accTree = { |
|
30 role: ROLE_RADIOBUTTON, |
|
31 children: [ ] |
|
32 }; |
|
33 |
|
34 testAccessibleTree("radio", accTree); |
|
35 |
|
36 // input@type="button" and input@type="submit" |
|
37 // button |
|
38 accTree = { |
|
39 role: ROLE_PUSHBUTTON, |
|
40 children: [ |
|
41 { |
|
42 role: ROLE_TEXT_LEAF // XXX Bug 567203 |
|
43 } |
|
44 ] |
|
45 }; |
|
46 |
|
47 testAccessibleTree("btn1", accTree); |
|
48 testAccessibleTree("submit", accTree); |
|
49 testAccessibleTree("btn2", accTree); |
|
50 |
|
51 // input@type="image" |
|
52 accTree = { |
|
53 role: ROLE_PUSHBUTTON, |
|
54 children: [ |
|
55 { |
|
56 role: ROLE_STATICTEXT |
|
57 } |
|
58 ] |
|
59 }; |
|
60 testAccessibleTree("image_submit", accTree); |
|
61 |
|
62 // input@type="range" |
|
63 accTree = { SLIDER: [ ] }; |
|
64 testAccessibleTree("range", accTree); |
|
65 |
|
66 // input@type="number" |
|
67 accTree = |
|
68 { SPINBUTTON: [ |
|
69 { ENTRY: [ ] }, |
|
70 { PUSHBUTTON: [ ] }, |
|
71 { PUSHBUTTON: [ ] } |
|
72 ] }; |
|
73 testAccessibleTree("number", accTree); |
|
74 |
|
75 // output |
|
76 accTree = { |
|
77 role: ROLE_SECTION, |
|
78 children: [ |
|
79 { |
|
80 role: ROLE_TEXT_LEAF |
|
81 } |
|
82 ] |
|
83 }; |
|
84 testAccessibleTree("output", accTree); |
|
85 |
|
86 SimpleTest.finish(); |
|
87 } |
|
88 |
|
89 SimpleTest.waitForExplicitFinish(); |
|
90 addA11yLoadEvent(doTest); |
|
91 </script> |
|
92 </head> |
|
93 <body> |
|
94 |
|
95 <a target="_blank" |
|
96 title="Fix O(n^2) access to all the children of a container" |
|
97 href="https://bugzilla.mozilla.org/show_bug.cgi?id=342045"> |
|
98 Bug 342045 |
|
99 </a> |
|
100 <a target="_blank" |
|
101 title="add test for role of input type='image'" |
|
102 href="https://bugzilla.mozilla.org/show_bug.cgi?id=524521"> |
|
103 Bug 524521 |
|
104 </a> |
|
105 <a target="_blank" |
|
106 href="https://bugzilla.mozilla.org/show_bug.cgi?id=558036" |
|
107 title="make HTML <output> accessible"> |
|
108 Bug 558036 |
|
109 </a> |
|
110 <a target="_blank" |
|
111 href="https://bugzilla.mozilla.org/show_bug.cgi?id=559764" |
|
112 title="make HTML5 input@type=range element accessible"> |
|
113 Bug 559764 |
|
114 </a> |
|
115 <p id="display"></p> |
|
116 <div id="content" style="display: none"></div> |
|
117 <pre id="test"> |
|
118 </pre> |
|
119 |
|
120 <input type="checkbox" id="checkbox"> |
|
121 <input type="radio" id="radio"> |
|
122 <input type="button" value="button" id="btn1"> |
|
123 <button id="btn2">button</button> |
|
124 |
|
125 <input type="submit" id="submit"> |
|
126 <input type="image" id="image_submit"> |
|
127 <input type="range" id="range"> |
|
128 <input type="number" id="number"> |
|
129 <output id="output">1337</output> |
|
130 |
|
131 </body> |
|
132 </html> |