AX: Remove tight platform expectation coupling form roles-exposed layout test.
[WebKit-https.git] / LayoutTests / accessibility / roles-exposed.html
1 <!DOCTYPE HTML>
2 <html>
3 <body>
4 <script src="../resources/js-test-pre.js"></script>
5
6 <!-- ==================================================================================================== -->
7 <!-- HTML elements in alphabetical order, excepting the need for nesting (e.g. <li> is with its <ol> and <ul> parents) -->
8 <!-- ==================================================================================================== -->
9 <a data-platform="atk,mac" href="#" data-note="[href]" class="ex">X</a>
10 <!-- [ATK] Skipped: not focusable --><a data-platform="mac" data-note=":not([href])" class="ex">X</a>
11 <!-- [ATK] Skipped: not focusable --><abbr data-platform="mac" class="ex">X</abbr>
12 <!-- http://webkit.org/b/83989 --><address data-platform="atk,mac" class="ex">X</address>
13 <!-- skipped <area> -->
14 <article data-platform="atk,mac" class="ex">X</article>
15 <aside data-platform="atk,mac" class="ex">X</aside>
16 <!-- [ATK] Object not exposed (webkit.org/b/125491) --><audio data-platform="mac" class="ex">X</audio>
17 <!-- [ATK] Skipped: not focusable --><b data-platform="mac" class="ex">X</b>
18 <!-- [ATK] Skipped: not focusable --><bdo data-platform="mac" class="ex">X</bdo>
19 <blockquote data-platform="atk,mac" class="ex">X</blockquote>
20 <button data-platform="atk,mac" class="ex">X</button>
21 <!-- [ATK] Object not exposed (webkit.org/b/125491) --><canvas data-platform="mac" class="ex">X</canvas>
22 <!-- [ATK] Object not exposed (webkit.org/b/125491) --><cite data-platform="mac" class="ex">X</cite>
23 <!-- [ATK] Object not exposed (webkit.org/b/125491) --><code data-platform="mac" class="ex">X</code>
24 <!-- skipped <command> -->
25 <!-- skipped <datalist> -->
26 <!-- [ATK] Skipped: not focusable --><del data-platform="mac" class="ex">X</del>
27 <!-- skipped <details/summary> http://webkit.org/b/108979 -->
28 <!-- [ATK] Skipped: not focusable --><dfn data-platform="mac" class="ex">X</dfn>
29 <dl data-platform="atk,mac" class="ex">
30     <dt data-platform="atk,mac" class="ex">X</dt>
31     <dd data-platform="atk,mac" class="ex">X</dd>
32 </dl>
33 <div data-platform="atk,mac" class="ex">X</div>
34 <!-- [ATK] Skipped: not focusable --><em data-platform="mac" class="ex">X</em>
35 <!-- skipped <embed> -->
36 <fieldset data-platform="atk,mac" class="ex">
37     <legend data-platform="atk,mac" class="ex">X</legend>
38 </fieldset>
39 <!-- skipped figure/figcaption http://webkit.org/b/108996 -->
40 <!-- [ATK] Skipped: not focusable --><footer data-platform="mac" class="ex">X</footer>
41 <form data-platform="atk,mac" class="ex">X</form>
42 <!-- skipped <frame> -->
43 <!-- skipped <frameset> -->
44 <!-- skipped <head> -->
45 <!-- http://webkit.org/b/109013 --><header data-platform="atk,mac" class="ex">X</header>
46 <hgroup data-platform="atk,mac" class="ex">X</hgroup>
47 <h1 data-platform="atk,mac" class="ex">X</h1>
48 <h2 data-platform="atk,mac" class="ex">X</h2>
49 <h3 data-platform="atk,mac" class="ex">X</h3>
50 <h4 data-platform="atk,mac" class="ex">X</h4>
51 <h5 data-platform="atk,mac" class="ex">X</h5>
52 <h6 data-platform="atk,mac" class="ex">X</h6>
53 <hr data-platform="atk,mac" class="ex">
54 <!-- skipped <html> -->
55 <!-- [ATK] Skipped: not focusable --><i data-platform="mac" class="ex">X</i>
56 <!-- skipped <iframe> -->
57 <!-- [ATK] Object not exposed (webkit.org/b/125491) --><img data-platform="mac" class="ex" data-note=":not([src]):not([alt])">
58 <!-- [ATK] Object not exposed (webkit.org/b/125491) --><img data-platform="mac" class="ex" alt="" data-note="[alt='']">
59 <!-- [ATK] Object not exposed (webkit.org/b/125491) --><img data-platform="mac" class="ex" src="foo.png" data-note="[src]:not([alt])">
60 <img data-platform="atk,mac" class="ex" alt="X" data-note="[alt='X']">
61 <input data-platform="atk,mac" type="button" value="X" class="ex" data-note="[type='button']">
62 <!-- skipped <menu><input type="button"></menu> -->
63 <!-- [ATK] Wrong role (webkit.org/b/125493) --><!-- http://webkit.org/b/109017 --><input data-platform="mac" type="color" value="X" class="ex" data-note="[type='color']">
64 <input data-platform="atk,mac" type="checkbox" class="ex" data-note="[type='checkbox']">
65 <!-- skipped <menu><input type="checkbox"></menu> -->
66 <!-- http://webkit.org/b/109017 --><input data-platform="atk,mac" type="date" value="X" class="ex" data-note="[type='date']">
67 <!-- http://webkit.org/b/109017 --><input data-platform="atk,mac" type="datetime" value="X" class="ex" data-note="[type='datetime']">
68 <!-- http://webkit.org/b/109017 --><input data-platform="atk,mac" type="datetime-local" value="X" class="ex" data-note="[type='datetime-local']">
69 <!-- http://webkit.org/b/109017 --><input data-platform="atk,mac" type="email" value="X" class="ex" data-note="[type='email']">
70 <input data-platform="atk,mac" type="file" class="ex" data-note="[type='file']">
71 <!-- [ATK] Skipped: not focusable --><input data-platform="mac" type="hidden" class="ex" data-note="[type='hidden']">
72 <input data-platform="atk,mac" type="image" class="ex" data-note="[type='image']">
73 <!-- http://webkit.org/b/109017 --><input data-platform="atk,mac" type="month" value="X" class="ex" data-note="[type='month']">
74 <!-- http://webkit.org/b/109017 --><input data-platform="atk,mac" type="number" value="X" class="ex" data-note="[type='number']">
75 <input data-platform="atk,mac" type="password" value="X" class="ex" data-note="[type='password']">
76 <input data-platform="atk,mac" type="radio" class="ex" data-note="[type='radio']">
77 <!-- skipped <menu><input type="radio"></menu> -->
78 <input data-platform="atk,mac" type="range" class="ex" data-note="[type='range']">
79 <input data-platform="atk,mac" type="reset" class="ex" data-note="[type='reset']">
80 <input data-platform="atk,mac" type="search" value="X" class="ex" data-note="[type='search']">
81 <input data-platform="atk,mac" type="submit" class="ex" data-note="[type='submit']">
82 <!-- http://webkit.org/b/109017 --><input data-platform="atk,mac" type="tel" value="X" class="ex" data-note="[type='tel']">
83 <input data-platform="atk,mac" type="text" value="X" class="ex" data-note="[type='text']">
84 <!-- skipped <input type="text"> with suggestions source element: http://www.w3.org/html/wg/drafts/html/master/forms.html#concept-input-list -->
85 <!-- http://webkit.org/b/109017 --><input data-platform="atk,mac" type="time" value="X" class="ex" data-note="[type='time']">
86 <!-- http://webkit.org/b/109017 --><input data-platform="atk,mac" type="url" value="X" class="ex" data-note="[type='url']">
87 <!-- http://webkit.org/b/109017 --><input data-platform="atk,mac" type="week" value="X" class="ex" data-note="[type='week']">
88 <!-- [ATK] Skipped: not focusable --><ins data-platform="mac" class="ex">X</ins>
89 <!-- skipped <link> -->
90 <!-- skipped <map> -->
91 <!-- [ATK] Skipped: not focusable --><!-- http://webkit.org/b/109018 --><mark data-platform="mac" class="ex">X</mark>
92 <math data-platform="atk,mac" class="ex">X</math>
93 <!-- skipped <menu> -->
94 <!-- skipped <meta> -->
95 <!-- [ATK] Object not exposed (webkit.org/b/125491) --><meter data-platform="mac" class="ex" value="0.75">X</meter>
96 <nav data-platform="atk,mac" class="ex">X</nav>
97 <!-- skipped <noscript> -->
98 <!-- skipped <object> -->
99 <ol data-platform="atk,mac" class="ex">
100     <li data-platform="atk,mac" class="ex">X</li>
101 </ol>
102 <!-- skipped <optgroup> -->
103 <!-- skipped <option> -->
104 <!-- skipped <output> -->
105 <p data-platform="atk,mac" class="ex">X</p>
106 <!-- skipped <param> -->
107 <pre data-platform="atk,mac" class="ex">X</pre>
108 <progress data-platform="atk,mac" class="ex" value="0.75">X</progress>
109 <!-- [ATK] Skipped: not focusable --><q data-platform="mac" class="ex">X</q>
110 <!-- skipped <ruby/rp/rt> -->
111 <!-- [ATK] Skipped: not focusable --><s data-platform="mac" class="ex">X</s>
112 <!-- [ATK] Skipped: not focusable --><samp data-platform="mac" class="ex">X</samp>
113 <!-- skipped <script> -->
114 <!-- [ATK] Wrong role (webkit.org/b/125493) --><!-- http://webkit.org/b/109024 --><section data-platform="mac" class="ex">X</section>
115 <select data-platform="atk,mac" class="ex" data-note=":not([multiple])">
116     <!-- [ATK] Object not exposed (webkit.org/b/125491) --><option data-platform="mac" class="ex">X</option>
117     <!-- [ATK] Object not exposed (webkit.org/b/125491) --><optgroup data-platform="mac" class="ex" label="more">
118         <!-- [ATK] Object not exposed (webkit.org/b/125491) --><option data-platform="mac">X</option>
119     </optgroup>
120 </select>
121 <select data-platform="atk,mac" class="ex" multiple data-note="[multiple]">
122     <option data-platform="atk,mac" class="ex">X</option>
123     <optgroup data-platform="atk,mac" class="ex" label="more">
124         <option>Y</option>
125         <option>Z</option>
126     </optgroup>
127 </select>
128 <!-- [ATK] Skipped: not focusable --><small data-platform="mac" class="ex">X</small>
129 <!-- skipped <source> -->
130 <!-- [ATK] Skipped: not focusable --><span data-platform="mac" class="ex">X</span>
131 <!-- [ATK] Skipped: not focusable --><strong data-platform="mac" class="ex">X</strong>
132 <!-- skipped <style> -->
133 <!-- [ATK] Skipped: not focusable --><sub data-platform="mac" class="ex">X</sub>
134 <!-- [ATK] Skipped: not focusable --><sup data-platform="mac" class="ex">X</sup>
135 <!-- [ATK] Object not exposed (webkit.org/b/125491) --><svg data-platform="mac" class="ex">X</svg>
136
137 <table data-platform="atk,mac" class="ex">
138     <!-- [ATK] Skipped: not to be exposed --><caption data-platform="mac" class="ex">X</caption>
139     <!-- Not to be exposed in ATK--><thead data-platform="mac" class="ex">
140         <!-- [ATK] Object not exposed (webkit.org/b/125491) --><tr data-platform="mac" class="ex">
141             <!-- Need separate test to verify colheader/rowheader -->
142             <th data-platform="atk,mac" class="ex">X</th>
143         </tr>
144     </thead>
145     <!-- [ATK] Skipped: not to be exposed --><tbody data-platform="mac" class="ex">
146         <!-- [ATK] Object not exposed (webkit.org/b/125491) --><tr data-platform="mac" class="ex">
147             <td data-platform="atk,mac" class="ex">X</td>
148         </tr>
149     </tbody>
150     <!-- [ATK] Skipped: not to be exposed --><tfoot data-platform="mac" class="ex">
151         <!-- [ATK] Object not exposed (webkit.org/b/125491) --><tr data-platform="mac" class="ex">
152             <!-- Need separate test to verify colheader/rowheader -->
153             <th data-platform="atk,mac" class="ex">X</th>
154         </tr>
155     </tfoot>
156 </table>
157 <textarea data-platform="atk,mac" class="ex">X</textarea>
158 <!-- [ATK] Object not exposed (webkit.org/b/125491) --><time data-platform="mac" class="ex">X</time>
159 <!-- skipped <title> -->
160 <ul data-platform="atk,mac" class="ex">
161     <li data-platform="atk,mac" class="ex">X</li>
162 </ul>
163 <!-- [ATK] Skipped: not focusable --><var data-platform="mac" class="ex">X</var>
164 <!-- skipped <video> -->
165 <!-- [ATK] Skipped: not focusable --><wbr data-platform="mac" class="ex">X</wbr>
166 <!-- Todo: I left off adding HTML5 elements here at previous element: https://dvcs.w3.org/hg/html-api-map/raw-file/default/Overview.html -->
167
168
169
170 <!-- ==================================================================================================== -->
171 <!-- Abstract ARIA roles in alphabetical order; only generic AXGroup role should be exposed on abstract roles -->
172 <!-- ==================================================================================================== -->
173 <div role="command"     data-platform="atk,mac" class="ex">X</div>
174 <div role="composite"   data-platform="atk,mac" class="ex">X</div>
175 <div role="input"       data-platform="atk,mac" class="ex">X</div>
176 <div role="landmark"    data-platform="atk,mac" class="ex">X</div>
177 <div role="range"       data-platform="atk,mac" class="ex">X</div>
178 <div role="roletype"    data-platform="atk,mac" class="ex">X</div>
179 <div role="section"     data-platform="atk,mac" class="ex">X</div>
180 <div role="sectionhead" data-platform="atk,mac" class="ex">X</div>
181 <div role="select"      data-platform="atk,mac" class="ex">X</div>
182 <div role="structure"   data-platform="atk,mac" class="ex">X</div>
183 <div role="widget"      data-platform="atk,mac" class="ex">X</div>
184 <div role="window"      data-platform="atk,mac" class="ex">X</div>
185
186
187 <!-- ==================================================================================================== -->
188 <!-- Non-abstract ARIA roles in alphabetical order, excepting the need for nesting (e.g. row is with its grid parent) -->
189 <!-- ==================================================================================================== -->
190 <div role="alert"                    data-platform="atk,mac" class="ex">X</div>
191 <div role="alertdialog"              data-platform="atk,mac" class="ex">X</div>
192 <div role="application"              data-platform="atk,mac" class="ex">X</div>
193 <div role="article"                  data-platform="atk,mac" class="ex">X</div>
194 <div role="banner"                   data-platform="atk,mac" class="ex">X</div>
195 <div role="button"                   data-platform="atk,mac" class="ex">X</div>
196 <div role="checkbox"                 data-platform="atk,mac" class="ex">X</div>
197 <div role="combobox"                 data-platform="atk,mac" class="ex">X</div>
198 <div role="complementary"            data-platform="atk,mac" class="ex">X</div>
199 <div role="contentinfo"              data-platform="atk,mac" class="ex">X</div>
200 <div role="definition"               data-platform="atk,mac" class="ex">X</div>
201 <div role="dialog"                   data-platform="atk,mac" class="ex">X</div>
202 <div role="directory"                data-platform="atk,mac" class="ex">X</div>
203 <!-- [ATK] Object not exposed (webkit.org/b/125491) --><div data-platform="mac" role="document" class="ex">X</div>
204 <!-- [ATK] Wrong role (webkit.org/b/125493) --><div data-platform="mac" role="form"     class="ex">X</div>
205 <div data-platform="atk,mac" role="grid"                     class="ex">
206     <!-- [ATK] Object not exposed (webkit.org/b/125491) --><div data-platform="mac" role="rowgroup"             class="ex">
207         <!-- [ATK] Object not exposed (webkit.org/b/125491) --><div data-platform="mac" role="row"              class="ex">
208             <!-- Note: diff between rowheader, columnheader, and gridcell is in cross-reference from grid; need additional non-role verification in another test. -->
209             <!-- [ATK] Wrong role (webkit.org/b/125493) --><div data-platform="mac" role="rowheader"    class="ex">X</div>
210             <!-- [ATK] Wrong role (webkit.org/b/125493) --><div data-platform="mac" role="columnheader" class="ex">X</div>
211             <div data-platform="atk,mac" role="gridcell"     class="ex">X</div>
212         </div>
213     </div>
214 </div>
215 <div role="group"                    data-platform="atk,mac" class="ex">X</div>
216 <div role="heading"                  data-platform="atk,mac" class="ex">X</div>
217 <div role="img"                      data-platform="atk,mac" class="ex">X</div>
218 <div role="link"                     data-platform="atk,mac" class="ex">X</div>
219 <div role="list"                     data-platform="atk,mac" class="ex">
220     <div role="listitem"             data-platform="atk,mac" class="ex">X</div>
221 </div>
222 <!-- [ATK] Object not exposed (webkit.org/b/125491) --><div role="listbox" data-platform="mac" class="ex">
223     <div role="option"               data-platform="atk,mac" class="ex">X</div>
224 </div>
225 <div role="log"                      data-platform="atk,mac" class="ex">X</div>
226 <div role="main"                     data-platform="atk,mac" class="ex">X</div>
227 <div role="marquee"                  data-platform="atk,mac" class="ex">X</div>
228 <div role="math"                     data-platform="atk,mac" class="ex">X</div>
229 <div role="menu"                     data-platform="atk,mac" class="ex">
230     <!-- Note: diff between menuitem types is an attribute; need additional non-role verification in another test. -->
231     <div role="menuitem"             data-platform="atk,mac" class="ex">X</div>
232     <div role="menuitemcheckbox"     data-platform="atk,mac" class="ex">X</div>
233     <div role="menuitemradio"        data-platform="atk,mac" class="ex">X</div>
234 </div>
235 <div role="menubar"                  data-platform="atk,mac" class="ex">
236     <!-- Note: diff between menuitem types is an attribute; need additional non-role verification in another test. -->
237     <div role="menuitem"             data-platform="atk,mac" class="ex">X</div>
238     <div role="menuitemcheckbox"     data-platform="atk,mac" class="ex">X</div>
239     <div role="menuitemradio"        data-platform="atk,mac" class="ex">X</div>
240 </div>
241 <div role="navigation"               data-platform="atk,mac" class="ex">X</div>
242 <div role="note"                     data-platform="atk,mac" class="ex">X</div>
243 <!-- [ATK] Skipped: not to be exposed --><div role="presentation" data-platform="mac" data-platform="atk,mac" class="ex">X</div>
244 <div role="progressbar"              data-platform="atk,mac" class="ex">X</div>
245 <div role="radiogroup"               data-platform="atk,mac" class="ex">
246     <div role="radio"                data-platform="atk,mac" class="ex">X</div>
247 </div>
248 <!-- [ATK] Wrong role (webkit.org/b/125493) --><div role="region" data-platform="mac" class="ex">X</div>
249 <div role="scrollbar"                data-platform="atk,mac" class="ex">X</div>
250 <div role="search"                   data-platform="atk,mac" class="ex">X</div>
251 <div role="separator"                data-platform="atk,mac" class="ex">X</div>
252 <div role="slider"                   data-platform="atk,mac" class="ex">X</div>
253 <div role="spinbutton"               data-platform="atk,mac" class="ex">X</div>
254 <!-- [ATK] Wrong role (webkit.org/b/125493) --><div role="status" data-platform="mac" class="ex">X</div>
255 <div role="tablist"                  data-platform="atk,mac" class="ex">
256     <div role="tab"                  data-platform="atk,mac" class="ex">X</div>
257 </div>
258 <!-- [ATK] Wrong role (webkit.org/b/125493) --><div role="tabpanel" data-platform="mac" class="ex">X</div>
259 <div role="textbox"                  data-platform="atk,mac" class="ex">X</div>
260 <div role="timer"                    data-platform="atk,mac" class="ex">X</div>
261 <div role="toolbar"                  data-platform="atk,mac" class="ex">X</div>
262 <!-- [ATK] Wrong role (webkit.org/b/125493) --><div role="tooltip"                  data-platform="mac" class="ex">X</div>
263 <!-- [ATK] Wrong role (webkit.org/b/125493) --><div role="tree"                     data-platform="mac" class="ex">
264     <!-- [ATK] Wrong role (webkit.org/b/125493) --><div role="treeitem"             data-platform="mac" class="ex">X</div>
265     <!-- [ATK] Wrong role (webkit.org/b/125493) --><div role="group"                data-platform="mac" class="ex">
266         <!-- [ATK] Wrong role (webkit.org/b/125493) --><div role="treeitem"         data-platform="mac" class="ex">X</div>
267     </div>
268 </div>
269 <div role="treegrid"                 data-platform="atk,mac" class="ex">
270     <!-- [ATK] Object not exposed (webkit.org/b/125491) --><div role="rowgroup"             data-platform="mac" class="ex">
271         <!-- [ATK] Object not exposed (webkit.org/b/125491) --><div role="row"              data-platform="mac" class="ex">
272             <!-- Note: diff between rowheader, columnheader, and gridcell is in cross-reference from grid; need additional non-role verification in another test. -->
273             <!-- [ATK] Wrong role (webkit.org/b/125493) --><div role="rowheader"    data-platform="mac" class="ex">X</div>
274             <!-- [ATK] Wrong role (webkit.org/b/125493) --><div role="columnheader" data-platform="mac" class="ex">X</div>
275             <div role="gridcell"     data-platform="atk,mac" class="ex">X</div>
276         </div>
277     </div>
278 </div>
279
280 <div id="console"></div>
281 <script>
282 if (window.testRunner && window.accessibilityController) {
283     description("This tests that native elements and ARIA overrides result in the expected role, subrole and role description.")
284     var currentPlatform = accessibilityController.platformName;
285     var examples = document.querySelectorAll('.ex');
286     var indent = "\n      "; // newline and six spaces
287     var el, supportedPlatforms, ariaRole, axElement, role, subrole, roleDescription, output, result;
288     for (var i = 0, c = examples.length; i < c; i++) {
289         el = examples[i];
290
291         supportedPlatforms = el.getAttribute('data-platform');
292         if (!supportedPlatforms || supportedPlatforms.indexOf(currentPlatform) == -1)
293             continue;
294
295         el.id = 'ex' + i;
296         ariaRole = el.getAttribute('role');
297         axElement = accessibilityController.accessibleElementById(el.id);
298         if (axElement) {
299             role = axElement.role;
300             subrole = axElement.subrole;
301             roleDescription = axElement.roleDescription;
302         } else {
303             role = 'AXRole: ';
304             subrole = 'AXSubrole: ';
305             roleDescription = 'AXRoleDescription: ';
306         }
307
308         output = el.tagName.toLowerCase() + (ariaRole?("[role="+ariaRole+"]"):'');
309         if (el.getAttribute('data-note')) {
310             output += el.getAttribute('data-note');
311         }
312         output += indent;
313         output += role + indent;
314
315         // In the Mac platform more things than just the role
316         // are tested so we need to expand a bit the output.
317         if (currentPlatform == "mac")
318             output += subrole + indent + roleDescription + indent;
319
320         result = document.getElementById('console');
321         result.innerText += output + "\n";
322     }
323
324     // Once tests are complete, hide all the example markup.
325     examples = document.querySelectorAll('.ex');
326     for (var i = 0, c = examples.length; i < c; i++) {
327         el = examples[i];
328         el.style.display = 'none';
329     }
330 }
331 </script>
332 <script src="../resources/js-test-post.js"></script>
333 </body>
334 </html>