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>
4 <head>
5 <title>HTML text controls tests</title>
6 <link rel="stylesheet" type="text/css"
7 href="chrome://mochikit/content/tests/SimpleTest/test.css" />
9 <script type="application/javascript"
10 src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
12 <script type="application/javascript"
13 src="../common.js"></script>
14 <script type="application/javascript"
15 src="../role.js"></script>
17 <script type="application/javascript">
18 function doTest()
19 {
20 // editable div
21 var accTree = {
22 role: ROLE_SECTION,
23 children: [
24 { // text child
25 role: ROLE_TEXT_LEAF,
26 children: []
27 }
28 ]
29 };
31 testAccessibleTree("txc1", accTree);
33 // input@type="text", value
34 accTree = {
35 role: ROLE_ENTRY,
36 children: [
37 { // text child
38 role: ROLE_TEXT_LEAF,
39 children: []
40 }
41 ]
42 };
44 testAccessibleTree("txc2", accTree);
46 // input@type="text", no value
47 accTree =
48 { ENTRY: [ ] };
50 testAccessibleTree("txc3", accTree);
52 // textarea
53 accTree = {
54 role: ROLE_ENTRY,
55 children: [
56 {
57 role: ROLE_TEXT_LEAF // hello1\nhello2 text
58 }
59 ]
60 };
62 testAccessibleTree("txc4", accTree);
64 // input@type="password"
65 accTree = {
66 role: ROLE_PASSWORD_TEXT,
67 children: [
68 {
69 role: ROLE_TEXT_LEAF,
70 children: []
71 }
72 ]
73 };
75 testAccessibleTree("txc5", accTree);
77 // input@type="tel", value
78 accTree = {
79 role: ROLE_ENTRY,
80 children: [
81 { // text child
82 role: ROLE_TEXT_LEAF,
83 children: []
84 }
85 ]
86 };
88 testAccessibleTree("txc6", accTree);
90 // input@type="email", value
91 accTree = {
92 role: ROLE_ENTRY,
93 children: [
94 { // text child
95 role: ROLE_TEXT_LEAF,
96 children: []
97 }
98 ]
99 };
101 testAccessibleTree("txc7", accTree);
103 // input@type="search", value
104 accTree = {
105 role: ROLE_ENTRY,
106 children: [
107 { // text child
108 role: ROLE_TEXT_LEAF,
109 children: []
110 }
111 ]
112 };
114 testAccessibleTree("txc8", accTree);
116 SimpleTest.finish();
117 }
119 SimpleTest.waitForExplicitFinish();
120 addA11yLoadEvent(doTest);
121 </script>
122 </head>
123 <body>
125 <a target="_blank"
126 title="overflowed content doesn't expose child text accessibles"
127 href="https://bugzilla.mozilla.org/show_bug.cgi?id=489306">
128 Mozilla Bug 489306
129 </a><br>
130 <a target="_blank"
131 href="https://bugzilla.mozilla.org/show_bug.cgi?id=542824"
132 title="Create child accessibles for text controls from native anonymous content">
133 Mozilla Bug 542824
134 </a>
135 <a target="_blank"
136 href="https://bugzilla.mozilla.org/show_bug.cgi?id=625652"
137 title="Make sure accessible tree is correct when rendered text is changed">
138 Mozilla Bug 625652
139 </a>
141 <p id="display"></p>
142 <div id="content" style="display: none"></div>
143 <pre id="test">
144 </pre>
146 <div id="txc1" contentEditable="true">
147 1hellohello
148 </div>
149 <input id="txc2" value="hello">
150 <input id="txc3">
151 <textarea id="txc4">
152 hello1
153 hello2
154 </textarea>
155 <input id="txc5" type="password" value="hello">
156 <input id="txc6" type="tel" value="4167771234">
158 Email Address:
159 <input id="txc7" type="email" list="contacts" value="xyzzy">
160 <datalist id="contacts">
161 <option>xyzzy@plughs.com</option>
162 <option>nobody@mozilla.org</option>
163 </datalist>
165 </br>Search for:
166 <input id="txc8" type="search" list="searchhisty" value="Gamma">
167 <datalist id="searchhisty">
168 <option>Gamma Rays</option>
169 <option>Gamma Ray Bursts</option>
170 </datalist>
172 </body>
173 </html>