a0d9091f2c0d3eb007146b586e44d04867c4bfbe
[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" data-role="AXLink" data-subrole="" data-roledescription="link" href="#" data-note="[href]" class="ex">X</a>
10 <!-- [ATK] Skipped: not focusable --><a data-platform="mac" data-role="" data-subrole="" data-roledescription="" data-note=":not([href])" class="ex">X</a>
11 <!-- [ATK] Skipped: not focusable --><abbr data-platform="mac" data-role="" data-subrole="" data-roledescription="" class="ex">X</abbr>
12 <!-- http://webkit.org/b/83989 --><address data-platform="atk,mac" data-role-atk="AXLandmarkContentInfo" data-role-mac="AXGroup" data-subrole="AXLandmarkContentInfo" data-roledescription="content information" class="ex">X</address>
13 <!-- skipped <area> -->
14 <article data-platform="atk,mac" data-role-atk="AXArticle" data-role-mac="AXGroup" data-subrole="AXDocumentArticle" data-roledescription="article" class="ex">X</article>
15 <aside data-platform="atk,mac" data-role-atk="AXLandmarkComplementary" data-role-mac="AXGroup" data-subrole="AXLandmarkComplementary" data-roledescription="complementary" class="ex">X</aside>
16 <!-- [ATK] Object not exposed (webkit.org/b/125491) --><audio data-platform="mac" data-role="" data-subrole="" data-roledescription="" class="ex">X</audio>
17 <!-- [ATK] Skipped: not focusable --><b data-platform="mac" data-role="" data-subrole="" data-roledescription="" class="ex">X</b>
18 <!-- [ATK] Skipped: not focusable --><bdo data-platform="mac" data-role="" data-subrole="" data-roledescription="" class="ex">X</bdo>
19 <blockquote data-platform="atk,mac" data-role="AXGroup" data-subrole="" data-roledescription="group" class="ex">X</blockquote>
20 <button data-platform="atk,mac" data-role="AXButton" data-subrole="" data-roledescription="button" class="ex">X</button>
21 <!-- [ATK] Object not exposed (webkit.org/b/125491) --><canvas data-platform="mac" data-role="" data-subrole="" data-roledescription="" class="ex">X</canvas>
22 <!-- [ATK] Object not exposed (webkit.org/b/125491) --><cite data-platform="mac" data-role="" data-subrole="" data-roledescription="" class="ex">X</cite>
23 <!-- [ATK] Object not exposed (webkit.org/b/125491) --><code data-platform="mac" data-role="" data-subrole="" data-roledescription="" class="ex">X</code>
24 <!-- skipped <command> -->
25 <!-- skipped <datalist> -->
26 <!-- [ATK] Skipped: not focusable --><del data-platform="mac" data-role="" data-subrole="" data-roledescription="" class="ex">X</del>
27 <!-- skipped <details/summary> http://webkit.org/b/108979 -->
28 <!-- [ATK] Skipped: not focusable --><dfn data-platform="mac" data-role="AXGroup" data-subrole="AXDefinition" data-roledescription="definition" class="ex">X</dfn>
29 <dl data-platform="atk,mac" data-role-atk="AXDescriptionList" data-role-mac="AXList" data-subrole="AXDescriptionList" data-alternatesubrole="AXDefinitionList" data-roledescription="description list" class="ex">
30     <dt data-platform="atk,mac" data-role-atk="AXDescriptionTerm" data-role-mac="AXGroup" data-subrole="AXTerm" data-roledescription="term" class="ex">X</dt>
31     <dd data-platform="atk,mac" data-role-atk="AXDescriptionValue" data-role-mac="AXGroup" data-subrole="AXDescription" data-roledescription="description" class="ex">X</dd>
32 </dl>
33 <div data-platform="atk,mac" data-role-atk="AXSection" data-role-mac="AXGroup" data-subrole="" data-roledescription="group" class="ex">X</div>
34 <!-- [ATK] Skipped: not focusable --><em data-platform="mac" data-role="" data-subrole="" data-roledescription="" class="ex">X</em>
35 <!-- skipped <embed> -->
36 <fieldset data-platform="atk,mac" data-role="AXGroup" data-subrole="" data-roledescription="group" class="ex">
37     <legend data-platform="atk,mac" data-role="" data-role-atk="AXLabel" data-subrole="" data-roledescription="" class="ex">X</legend>
38 </fieldset>
39 <!-- skipped figure/figcaption http://webkit.org/b/108996 -->
40 <!-- [ATK] Skipped: not focusable --><footer data-platform="mac" data-role="AXGroup" data-subrole="AXLandmarkContentInfo" data-roledescription="footer" class="ex">X</footer>
41 <form data-platform="atk,mac" data-role-atk="AXForm" data-role-mac="AXGroup" data-subrole="" data-roledescription="group" class="ex">X</form>
42 <!-- skipped <frame> -->
43 <!-- skipped <frameset> -->
44 <!-- skipped <head> -->
45 <!-- http://webkit.org/b/109013 --><header data-platform="atk,mac" data-role-atk="AXLandmarkBanner" data-role-mac="AXGroup" data-subrole="AXLandmarkBanner" data-roledescription="banner" class="ex">X</header>
46 <hgroup data-platform="atk,mac" data-role="AXGroup" data-subrole="" data-roledescription="group" class="ex">X</hgroup>
47 <h1 data-platform="atk,mac" data-role="AXHeading" data-subrole="" data-roledescription="heading" class="ex">X</h1>
48 <h2 data-platform="atk,mac" data-role="AXHeading" data-subrole="" data-roledescription="heading" class="ex">X</h2>
49 <h3 data-platform="atk,mac" data-role="AXHeading" data-subrole="" data-roledescription="heading" class="ex">X</h3>
50 <h4 data-platform="atk,mac" data-role="AXHeading" data-subrole="" data-roledescription="heading" class="ex">X</h4>
51 <h5 data-platform="atk,mac" data-role="AXHeading" data-subrole="" data-roledescription="heading" class="ex">X</h5>
52 <h6 data-platform="atk,mac" data-role="AXHeading" data-subrole="" data-roledescription="heading" class="ex">X</h6>
53 <hr data-platform="atk,mac" data-role-mac="AXSplitter" data-role-atk="AXSeparator" data-subrole="AXContentSeparator" data-roledescription="separator" class="ex">
54 <!-- skipped <html> -->
55 <!-- [ATK] Skipped: not focusable --><i data-platform="mac" data-role="" data-subrole="" data-roledescription="" class="ex">X</i>
56 <!-- skipped <iframe> -->
57 <!-- [ATK] Object not exposed (webkit.org/b/125491) --><img data-platform="mac" data-role="" data-subrole="" data-roledescription="" class="ex" data-note=":not([src]):not([alt])">
58 <!-- [ATK] Object not exposed (webkit.org/b/125491) --><img data-platform="mac" data-role="" data-subrole="" data-roledescription="" class="ex" alt="" data-note="[alt='']">
59 <!-- [ATK] Object not exposed (webkit.org/b/125491) --><img data-platform="mac" data-role="" data-subrole="" data-roledescription="" class="ex" src="foo.png" data-note="[src]:not([alt])">
60 <img data-platform="atk,mac" data-role="AXImage" data-subrole="" data-roledescription="image" class="ex" alt="X" data-note="[alt='X']">
61 <input data-platform="atk,mac" type="button" value="X" data-role="AXButton" data-subrole="" data-roledescription="button" 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" data-role="AXColorWell" data-subrole="" data-roledescription="color well" class="ex" data-note="[type='color']">
64 <input data-platform="atk,mac" type="checkbox" data-role="AXCheckBox" data-subrole="" data-roledescription="check box" 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" data-role="AXTextField" data-subrole="" data-roledescription="text field" class="ex" data-note="[type='date']">
67 <!-- http://webkit.org/b/109017 --><input data-platform="atk,mac" type="datetime" value="X" data-role="AXTextField" data-subrole="" data-roledescription="text field" class="ex" data-note="[type='datetime']">
68 <!-- http://webkit.org/b/109017 --><input data-platform="atk,mac" type="datetime-local" value="X" data-role="AXTextField" data-subrole="" data-roledescription="text field" class="ex" data-note="[type='datetime-local']">
69 <!-- http://webkit.org/b/109017 --><input data-platform="atk,mac" type="email" value="X" data-role="AXTextField" data-subrole="" data-roledescription="text field" class="ex" data-note="[type='email']">
70 <input data-platform="atk,mac" type="file" data-role="AXButton" data-subrole="AXFileUploadButton" data-roledescription="file upload button" class="ex" data-note="[type='file']">
71 <!-- [ATK] Skipped: not focusable --><input data-platform="mac" type="hidden" data-role="" data-subrole="" data-roledescription="" class="ex" data-note="[type='hidden']">
72 <input data-platform="atk,mac" type="image" data-role="AXButton" data-subrole="" data-roledescription="button" class="ex" data-note="[type='image']">
73 <!-- http://webkit.org/b/109017 --><input data-platform="atk,mac" type="month" value="X" data-role="AXTextField" data-subrole="" data-roledescription="text field" class="ex" data-note="[type='month']">
74 <!-- http://webkit.org/b/109017 --><input data-platform="atk,mac" type="number" value="X" data-role="AXTextField" data-subrole="" data-roledescription="text field" class="ex" data-note="[type='number']">
75 <input data-platform="atk,mac" type="password" value="X" data-role-atk="AXPasswordField" data-role-mac="AXTextField" data-subrole="AXSecureTextField" data-roledescription="secure text field" class="ex" data-note="[type='password']">
76 <input data-platform="atk,mac" type="radio" data-role="AXRadioButton" data-subrole="" data-roledescription="radio button" class="ex" data-note="[type='radio']">
77 <!-- skipped <menu><input type="radio"></menu> -->
78 <input data-platform="atk,mac" type="range" data-role="AXSlider" data-subrole="" data-roledescription="slider" class="ex" data-note="[type='range']">
79 <input data-platform="atk,mac" type="reset" data-role="AXButton" data-subrole="" data-roledescription="button" class="ex" data-note="[type='reset']">
80 <input data-platform="atk,mac" type="search" value="X" data-role="AXTextField" data-subrole="AXSearchField" data-roledescription="search text field" class="ex" data-note="[type='search']">
81 <input data-platform="atk,mac" type="submit" data-role="AXButton" data-subrole="" data-roledescription="button" class="ex" data-note="[type='submit']">
82 <!-- http://webkit.org/b/109017 --><input data-platform="atk,mac" type="tel" value="X" data-role="AXTextField" data-subrole="" data-roledescription="text field" class="ex" data-note="[type='tel']">
83 <input data-platform="atk,mac" type="text" value="X" data-role="AXTextField" data-subrole="" data-roledescription="text field" 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" data-role="AXTextField" data-subrole="" data-roledescription="text field" class="ex" data-note="[type='time']">
86 <!-- http://webkit.org/b/109017 --><input data-platform="atk,mac" type="url" value="X" data-role="AXTextField" data-subrole="" data-roledescription="text field" class="ex" data-note="[type='url']">
87 <!-- http://webkit.org/b/109017 --><input data-platform="atk,mac" type="week" value="X" data-role="AXTextField" data-subrole="" data-roledescription="text field" class="ex" data-note="[type='week']">
88 <!-- [ATK] Skipped: not focusable --><ins data-platform="mac" data-role="" data-subrole="" data-roledescription="" class="ex">X</ins>
89 <!-- skipped <link> -->
90 <!-- skipped <map> -->
91 <!-- [ATK] Skipped: not focusable --><!-- http://webkit.org/b/109018 --><mark data-platform="mac" data-role="" data-subrole="" data-roledescription="" class="ex">X</mark>
92 <math data-platform="atk,mac" data-role-atk="AXMath" data-role-mac="AXGroup" data-subrole="AXDocumentMath" data-roledescription="math" class="ex">X</math>
93 <!-- skipped <menu> -->
94 <!-- skipped <meta> -->
95 <!-- [ATK] Object not exposed (webkit.org/b/125491) --><meter data-platform="mac" data-role="AXProgressIndicator" data-subrole="" data-roledescription="progress indicator" class="ex" value="0.75">X</meter>
96 <nav data-platform="atk,mac" data-role-atk="AXLandmarkNavigation" data-role-mac="AXGroup" data-subrole="AXLandmarkNavigation" data-roledescription="navigation" class="ex">X</nav>
97 <!-- skipped <noscript> -->
98 <!-- skipped <object> -->
99 <ol data-platform="atk,mac" data-role="AXList" data-subrole="AXContentList" data-roledescription="content list" class="ex">
100     <li data-platform="atk,mac" data-role-atk="AXListItem" data-role-mac="AXGroup" data-subrole="" data-roledescription="group" class="ex">X</li>
101 </ol>
102 <!-- skipped <optgroup> -->
103 <!-- skipped <option> -->
104 <!-- skipped <output> -->
105 <p data-platform="atk,mac" data-role-atk="AXParagraph" data-role-mac="AXGroup" data-subrole="" data-roledescription="group" class="ex">X</p>
106 <!-- skipped <param> -->
107 <pre data-platform="atk,mac" data-role="AXGroup" data-subrole="" data-roledescription="group" class="ex">X</pre>
108 <progress data-platform="atk,mac" data-role="AXProgressIndicator" data-subrole="" data-roledescription="progress indicator" class="ex" value="0.75">X</progress>
109 <!-- [ATK] Skipped: not focusable --><q data-platform="mac" data-role="" data-subrole="" data-roledescription="" class="ex">X</q>
110 <!-- skipped <ruby/rp/rt> -->
111 <!-- [ATK] Skipped: not focusable --><s data-platform="mac" data-role="" data-subrole="" data-roledescription="" class="ex">X</s>
112 <!-- [ATK] Skipped: not focusable --><samp data-platform="mac" data-role="" data-subrole="" data-roledescription="" class="ex">X</samp>
113 <!-- skipped <script> -->
114 <!-- [ATK] Wrong role (webkit.org/b/125493) --><!-- http://webkit.org/b/109024 --><section data-platform="mac" data-role="AXGroup" data-subrole="AXDocumentRegion" data-roledescription="region" class="ex">X</section>
115 <select data-platform="atk,mac" data-role-atk="AXComboBox" data-role-mac="AXPopUpButton" data-subrole="" data-roledescription="pop up button" class="ex" data-note=":not([multiple])">
116     <!-- [ATK] Object not exposed (webkit.org/b/125491) --><option data-platform="mac" data-role="" data-subrole="" data-roledescription="" class="ex">X</option>
117     <!-- [ATK] Object not exposed (webkit.org/b/125491) --><optgroup data-platform="mac" data-role="" data-subrole="" data-roledescription="" 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" data-role="AXList" data-subrole="" data-roledescription="list" class="ex" multiple data-note="[multiple]">
122     <option data-platform="atk,mac" data-role-atk="AXListItem" data-role-mac="AXStaticText" data-subrole="" data-roledescription="text" class="ex">X</option>
123     <optgroup data-platform="atk,mac" data-role-atk="AXListItem" data-role-mac="AXStaticText" data-subrole="" data-roledescription="text" 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" data-role="" data-subrole="" data-roledescription="" class="ex">X</small>
129 <!-- skipped <source> -->
130 <!-- [ATK] Skipped: not focusable --><span data-platform="mac" data-role="" data-subrole="" data-roledescription="" class="ex">X</span>
131 <!-- [ATK] Skipped: not focusable --><strong data-platform="mac" data-role="" data-subrole="" data-roledescription="" class="ex">X</strong>
132 <!-- skipped <style> -->
133 <!-- [ATK] Skipped: not focusable --><sub data-platform="mac" data-role="" data-subrole="" data-roledescription="" class="ex">X</sub>
134 <!-- [ATK] Skipped: not focusable --><sup data-platform="mac" data-role="" data-subrole="" data-roledescription="" class="ex">X</sup>
135 <!-- [ATK] Object not exposed (webkit.org/b/125491) --><svg data-platform="mac" data-role="" data-subrole="" data-roledescription="" class="ex">X</svg>
136
137 <table data-platform="atk,mac" data-role="AXTable" data-subrole="" data-roledescription="table" class="ex">
138     <!-- [ATK] Skipped: not to be exposed --><caption data-platform="mac" data-role="" data-subrole="" data-roledescription="" class="ex">X</caption>
139     <!-- Not to be exposed in ATK--><thead data-platform="mac" data-role="" data-subrole="" data-roledescription="" class="ex">
140         <!-- [ATK] Object not exposed (webkit.org/b/125491) --><tr data-platform="mac" data-role="AXRow" data-subrole="" data-roledescription="row" class="ex">
141             <!-- Need separate test to verify colheader/rowheader -->
142             <th data-platform="atk,mac" data-role="AXCell" data-subrole="" data-roledescription="cell" class="ex">X</th>
143         </tr>
144     </thead>
145     <!-- [ATK] Skipped: not to be exposed --><tbody data-platform="mac" data-role="" data-subrole="" data-roledescription="" class="ex">
146         <!-- [ATK] Object not exposed (webkit.org/b/125491) --><tr data-platform="mac" data-role="AXRow" data-subrole="" data-roledescription="row" class="ex">
147             <td data-platform="atk,mac" data-role="AXCell" data-subrole="" data-roledescription="cell" class="ex">X</td>
148         </tr>
149     </tbody>
150     <!-- [ATK] Skipped: not to be exposed --><tfoot data-platform="mac" data-role="" data-subrole="" data-roledescription="" class="ex">
151         <!-- [ATK] Object not exposed (webkit.org/b/125491) --><tr data-platform="mac" data-role="AXRow" data-subrole="" data-roledescription="row" class="ex">
152             <!-- Need separate test to verify colheader/rowheader -->
153             <th data-platform="atk,mac" data-role="AXCell" data-subrole="" data-roledescription="cell" class="ex">X</th>
154         </tr>
155     </tfoot>
156 </table>
157 <textarea data-platform="atk,mac" data-role-atk="AXTextField" data-role-mac="AXTextArea" data-subrole="" data-roledescription="text entry area" class="ex">X</textarea>
158 <!-- [ATK] Object not exposed (webkit.org/b/125491) --><time data-platform="mac" data-role="" data-subrole="" data-roledescription="" class="ex">X</time>
159 <!-- skipped <title> -->
160 <ul data-platform="atk,mac" data-role="AXList" data-subrole="AXContentList" data-roledescription="content list" class="ex">
161     <li data-platform="atk,mac" data-role-atk="AXListItem" data-role-mac="AXGroup" data-subrole="" data-roledescription="group" class="ex">X</li>
162 </ul>
163 <!-- [ATK] Skipped: not focusable --><var data-platform="mac" data-role="" data-subrole="" data-roledescription="" class="ex">X</var>
164 <!-- skipped <video> -->
165 <!-- [ATK] Skipped: not focusable --><wbr data-platform="mac" data-role="" data-subrole="" data-roledescription="" 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" data-role-atk="AXSection" data-role-mac="AXGroup" data-subrole="" data-roledescription="group" class="ex">X</div>
174 <div role="composite"   data-platform="atk,mac" data-role-atk="AXSection" data-role-mac="AXGroup" data-subrole="" data-roledescription="group" class="ex">X</div>
175 <div role="input"       data-platform="atk,mac" data-role-atk="AXSection" data-role-mac="AXGroup" data-subrole="" data-roledescription="group" class="ex">X</div>
176 <div role="landmark"    data-platform="atk,mac" data-role-atk="AXSection" data-role-mac="AXGroup" data-subrole="" data-roledescription="group" class="ex">X</div>
177 <div role="range"       data-platform="atk,mac" data-role-atk="AXSection" data-role-mac="AXGroup" data-subrole="" data-roledescription="group" class="ex">X</div>
178 <div role="roletype"    data-platform="atk,mac" data-role-atk="AXSection" data-role-mac="AXGroup" data-subrole="" data-roledescription="group" class="ex">X</div>
179 <div role="section"     data-platform="atk,mac" data-role-atk="AXSection" data-role-mac="AXGroup" data-subrole="" data-roledescription="group" class="ex">X</div>
180 <div role="sectionhead" data-platform="atk,mac" data-role-atk="AXSection" data-role-mac="AXGroup" data-subrole="" data-roledescription="group" class="ex">X</div>
181 <div role="select"      data-platform="atk,mac" data-role-atk="AXSection" data-role-mac="AXGroup" data-subrole="" data-roledescription="group" class="ex">X</div>
182 <div role="structure"   data-platform="atk,mac" data-role-atk="AXSection" data-role-mac="AXGroup" data-subrole="" data-roledescription="group" class="ex">X</div>
183 <div role="widget"      data-platform="atk,mac" data-role-atk="AXSection" data-role-mac="AXGroup" data-subrole="" data-roledescription="group" class="ex">X</div>
184 <div role="window"      data-platform="atk,mac" data-role-atk="AXSection" data-role-mac="AXGroup" data-subrole="" data-roledescription="group" 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" data-role-atk="AXAlert" data-role-mac="AXGroup" data-subrole="AXApplicationAlert" data-roledescription="alert" class="ex">X</div>
191 <div role="alertdialog"              data-platform="atk,mac" data-role-atk="AXAlert" data-role-mac="AXGroup" data-subrole="AXApplicationAlertDialog" data-roledescription="alert dialog" class="ex">X</div>
192 <div role="application"              data-platform="atk,mac" data-role-atk="AXEmbedded" data-role-mac="AXGroup" data-subrole="AXLandmarkApplication" data-roledescription="application" class="ex">X</div>
193 <div role="article"                  data-platform="atk,mac" data-role-atk="AXArticle" data-role-mac="AXGroup" data-subrole="AXDocumentArticle" data-roledescription="article" class="ex">X</div>
194 <div role="banner"                   data-platform="atk,mac" data-role-atk="AXLandmarkBanner" data-role-mac="AXGroup" data-subrole="AXLandmarkBanner" data-roledescription="banner" class="ex">X</div>
195 <div role="button"                   data-platform="atk,mac" data-role="AXButton" data-subrole="" data-roledescription="button" class="ex">X</div>
196 <div role="checkbox"                 data-platform="atk,mac" data-role="AXCheckBox" data-subrole="" data-roledescription="check box" class="ex">X</div>
197 <div role="combobox"                 data-platform="atk,mac" data-role="AXComboBox" data-subrole="" data-roledescription="combo box" class="ex">X</div>
198 <div role="complementary"            data-platform="atk,mac" data-role-atk="AXLandmarkComplementary" data-role-mac="AXGroup" data-subrole="AXLandmarkComplementary" data-roledescription="complementary" class="ex">X</div>
199 <div role="contentinfo"              data-platform="atk,mac" data-role-atk="AXLandmarkContentInfo" data-role-mac="AXGroup" data-subrole="AXLandmarkContentInfo" data-roledescription="content information" class="ex">X</div>
200 <div role="definition"               data-platform="atk,mac" data-role-atk="AXDefinition" data-role-mac="AXGroup" data-subrole="AXDefinition" data-roledescription="definition" class="ex">X</div>
201 <div role="dialog"                   data-platform="atk,mac" data-role-atk="AXDialog" data-role-mac="AXGroup" data-subrole="AXApplicationDialog" data-roledescription="dialog" class="ex">X</div>
202 <div role="directory"                data-platform="atk,mac" data-role="AXList" data-subrole="AXContentList" data-roledescription="content list" class="ex">X</div>
203 <!-- [ATK] Object not exposed (webkit.org/b/125491) --><div data-platform="mac" role="document" data-role="AXGroup" data-subrole="AXDocument" data-roledescription="document" class="ex">X</div>
204 <!-- [ATK] Wrong role (webkit.org/b/125493) --><div data-platform="mac" role="form"     data-role="AXGroup" data-subrole="" data-roledescription="group" class="ex">X</div>
205 <div data-platform="atk,mac" role="grid"                     data-role="AXTable" data-subrole="" data-roledescription="table" class="ex">
206     <!-- [ATK] Object not exposed (webkit.org/b/125491) --><div data-platform="mac" role="rowgroup"             data-role="" data-subrole="" data-roledescription="" class="ex">
207         <!-- [ATK] Object not exposed (webkit.org/b/125491) --><div data-platform="mac" role="row"              data-role="AXRow" data-subrole="" data-roledescription="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"    data-role="AXCell" data-subrole="" data-roledescription="cell" class="ex">X</div>
210             <!-- [ATK] Wrong role (webkit.org/b/125493) --><div data-platform="mac" role="columnheader" data-role="AXCell" data-subrole="" data-roledescription="cell" class="ex">X</div>
211             <div data-platform="atk,mac" role="gridcell"     data-role="AXCell" data-subrole="" data-roledescription="cell" class="ex">X</div>
212         </div>
213     </div>
214 </div>
215 <div role="group"                    data-platform="atk,mac" data-role="AXGroup" data-subrole="" data-roledescription="group" class="ex">X</div>
216 <div role="heading"                  data-platform="atk,mac" data-role="AXHeading" data-subrole="" data-roledescription="heading" class="ex">X</div>
217 <div role="img"                      data-platform="atk,mac" data-role="AXImage" data-subrole="" data-roledescription="image" class="ex">X</div>
218 <div role="link"                     data-platform="atk,mac" data-role="AXLink" data-subrole="" data-roledescription="link" class="ex">X</div>
219 <div role="list"                     data-platform="atk,mac" data-role="AXList" data-subrole="AXContentList" data-roledescription="content list" class="ex">
220     <div role="listitem"             data-platform="atk,mac" data-role-atk="AXListItem" data-role-mac="AXGroup" data-subrole="" data-roledescription="group" class="ex">X</div>
221 </div>
222 <!-- [ATK] Object not exposed (webkit.org/b/125491) --><div role="listbox" data-platform="mac" data-role="AXList" data-subrole="" data-roledescription="list" class="ex">
223     <div role="option"               data-platform="atk,mac" data-role-atk="AXListItem" data-role-mac="AXStaticText" data-subrole="" data-roledescription="text" class="ex">X</div>
224 </div>
225 <div role="log"                      data-platform="atk,mac" data-role-atk="AXLog" data-role-mac="AXGroup" data-subrole="AXApplicationLog" data-roledescription="log" class="ex">X</div>
226 <div role="main"                     data-platform="atk,mac" data-role-atk="AXLandmarkMain" data-role-mac="AXGroup" data-subrole="AXLandmarkMain" data-roledescription="main" class="ex">X</div>
227 <div role="marquee"                  data-platform="atk,mac" data-role-atk="AXMarquee" data-role-mac="AXGroup" data-subrole="AXApplicationMarquee" data-roledescription="marquee" class="ex">X</div>
228 <div role="math"                     data-platform="atk,mac" data-role-atk="AXMath" data-role-mac="AXGroup" data-subrole="AXDocumentMath" data-roledescription="math" class="ex">X</div>
229 <div role="menu"                     data-platform="atk,mac" data-role="AXMenu" data-subrole="" data-roledescription="menu" 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" data-role="AXMenuItem" data-subrole="" data-roledescription="menu item" class="ex">X</div>
232     <div role="menuitemcheckbox"     data-platform="atk,mac" data-role-atk="AXCheckMenuItem" data-role-mac="AXMenuItem" data-subrole="" data-roledescription="menu item" class="ex">X</div>
233     <div role="menuitemradio"        data-platform="atk,mac" data-role-atk="AXRadioMenuItem" data-role-mac="AXMenuItem" data-subrole="" data-roledescription="menu item" class="ex">X</div>
234 </div>
235 <div role="menubar"                  data-platform="atk,mac" data-role="AXMenuBar" data-subrole="" data-roledescription="menu bar" 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" data-role="AXMenuItem" data-subrole="" data-roledescription="menu item" class="ex">X</div>
238     <div role="menuitemcheckbox"     data-platform="atk,mac" data-role-atk="AXCheckMenuItem" data-role-mac="AXMenuItem" data-subrole="" data-roledescription="menu item" class="ex">X</div>
239     <div role="menuitemradio"        data-platform="atk,mac" data-role-atk="AXRadioMenuItem" data-role-mac="AXMenuItem" data-subrole="" data-roledescription="menu item" class="ex">X</div>
240 </div>
241 <div role="navigation"               data-platform="atk,mac" data-role-atk="AXLandmarkNavigation" data-role-mac="AXGroup" data-subrole="AXLandmarkNavigation" data-roledescription="navigation" class="ex">X</div>
242 <div role="note"                     data-platform="atk,mac" data-role-atk="AXComment" data-role-mac="AXGroup" data-subrole="AXDocumentNote" data-roledescription="note" class="ex">X</div>
243 <!-- [ATK] Skipped: not to be exposed --><div role="presentation" data-platform="mac" data-platform="atk,mac" data-role="" data-subrole="" data-roledescription="" class="ex">X</div>
244 <div role="progressbar"              data-platform="atk,mac" data-role="AXProgressIndicator" data-subrole="" data-roledescription="progress indicator" class="ex">X</div>
245 <div role="radiogroup"               data-platform="atk,mac" data-role-atk="AXGroup" data-role-mac="AXRadioGroup" data-subrole="" data-roledescription="radio group" class="ex">
246     <div role="radio"                data-platform="atk,mac" data-role="AXRadioButton" data-subrole="" data-roledescription="radio button" class="ex">X</div>
247 </div>
248 <!-- [ATK] Wrong role (webkit.org/b/125493) --><div role="region" data-platform="mac" data-role="AXGroup" data-subrole="AXDocumentRegion" data-roledescription="region" class="ex">X</div>
249 <div role="scrollbar"                data-platform="atk,mac" data-role="AXScrollBar" data-subrole="" data-roledescription="scroll bar" class="ex">X</div>
250 <div role="search"                   data-platform="atk,mac" data-role-atk="AXLandmarkSearch" data-role-mac="AXGroup" data-subrole="AXLandmarkSearch" data-roledescription="search" class="ex">X</div>
251 <div role="separator"                data-platform="atk,mac" data-role-atk="AXSeparator" data-role-mac="AXSplitter" data-subrole="" data-roledescription="splitter" class="ex">X</div>
252 <div role="slider"                   data-platform="atk,mac" data-role="AXSlider" data-subrole="" data-roledescription="slider" class="ex">X</div>
253 <div role="spinbutton"               data-platform="atk,mac" data-role-atk="AXSpinButton" data-role-mac="AXIncrementor" data-subrole="" data-roledescription="stepper" class="ex">X</div>
254 <!-- [ATK] Wrong role (webkit.org/b/125493) --><div role="status" data-platform="mac" data-role="AXGroup" data-subrole="AXApplicationStatus" data-roledescription="application status" class="ex">X</div>
255 <div role="tablist"                  data-platform="atk,mac" data-role="AXTabGroup" data-subrole="" data-roledescription="tab group" class="ex">
256     <div role="tab"                  data-platform="atk,mac" data-role-atk="AXTab" data-role-mac="AXRadioButton" data-subrole="" data-roledescription="tab" class="ex">X</div>
257 </div>
258 <!-- [ATK] Wrong role (webkit.org/b/125493) --><div role="tabpanel" data-platform="mac" data-role="AXGroup" data-subrole="AXTabPanel" data-roledescription="tab panel" class="ex">X</div>
259 <div role="textbox"                  data-platform="atk,mac" data-role="AXTextField" data-subrole="" data-roledescription="text field" class="ex">X</div>
260 <div role="timer"                    data-platform="atk,mac" data-role-atk="AXTimer" data-role-mac="AXGroup" data-subrole="AXApplicationTimer" data-roledescription="timer" class="ex">X</div>
261 <div role="toolbar"                  data-platform="atk,mac" data-role="AXToolbar" data-subrole="" data-roledescription="toolbar" class="ex">X</div>
262 <!-- [ATK] Wrong role (webkit.org/b/125493) --><div role="tooltip"                  data-platform="mac" data-role="AXGroup" data-subrole="AXUserInterfaceTooltip" data-roledescription="tooltip" class="ex">X</div>
263 <!-- [ATK] Wrong role (webkit.org/b/125493) --><div role="tree"                     data-platform="mac" data-role="AXOutline" data-subrole="" data-roledescription="outline" class="ex">
264     <!-- [ATK] Wrong role (webkit.org/b/125493) --><div role="treeitem"             data-platform="mac" data-role="AXRow" data-subrole="AXOutlineRow" data-roledescription="outline row" class="ex">X</div>
265     <!-- [ATK] Wrong role (webkit.org/b/125493) --><div role="group"                data-platform="mac" data-role="" data-subrole="" data-roledescription="" class="ex">
266         <!-- [ATK] Wrong role (webkit.org/b/125493) --><div role="treeitem"         data-platform="mac" data-role="AXRow" data-subrole="AXOutlineRow" data-roledescription="outline row" class="ex">X</div>
267     </div>
268 </div>
269 <div role="treegrid"                 data-platform="atk,mac" data-role="AXTable" data-subrole="" data-roledescription="table" class="ex">
270     <!-- [ATK] Object not exposed (webkit.org/b/125491) --><div role="rowgroup"             data-platform="mac" data-role="" data-subrole="" data-roledescription="" class="ex">
271         <!-- [ATK] Object not exposed (webkit.org/b/125491) --><div role="row"              data-platform="mac" data-role="AXRow" data-subrole="" data-roledescription="row" 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" data-role="AXCell" data-subrole="" data-roledescription="cell" class="ex">X</div>
274             <!-- [ATK] Wrong role (webkit.org/b/125493) --><div role="columnheader" data-platform="mac" data-role="AXCell" data-subrole="" data-roledescription="cell" class="ex">X</div>
275             <div role="gridcell"     data-platform="atk,mac" data-role="AXCell" data-subrole="" data-roledescription="cell" 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, expectedRole, expectation, matchedForPlatform, 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         expectedRole = "";
316         if (el.hasAttribute('data-role-' + currentPlatform)) {
317             expectedRole = el.getAttribute('data-role-' + currentPlatform);
318         } else if (el.hasAttribute('data-role')) {
319             expectedRole = el.getAttribute('data-role');
320         }
321
322         expectation = expectedRole;
323         matchedResults = (role.replace('AXRole: ','') == expectedRole)
324
325         // In the Mac platform more things than just the role are tested so we need to
326         // expand a bit the output and expected results, as well as add some extra checks.
327         if (currentPlatform == "mac") {
328             output += subrole + indent;
329             output += roleDescription + indent;
330
331             expectation += "/";
332             expectation += el.getAttribute('data-subrole');
333             if (el.getAttribute('data-alternatesubrole')) expectation += " or " + el.getAttribute('data-alternatesubrole');
334             expectation += "/" + el.getAttribute('data-roledescription');
335
336             matchedResults = matchedResults && (subrole.replace('AXSubrole: ','') == el.getAttribute('data-subrole') || subrole.replace('AXSubrole: ','') == el.getAttribute('data-alternatesubrole'));
337             matchedResults = matchedResults && (roleDescription.replace('AXRoleDescription: ','') == el.getAttribute('data-roledescription'));
338         }
339
340         result = document.getElementById('console');
341         if (matchedResults) {
342             result.innerText += "PASS: " + output + "\n";
343         } else {
344             result.innerText += "FAIL: " + output + "Expected: " + expectation + "\n\n";
345         }
346     }
347
348     // Once tests are complete, hide all the example markup.
349     examples = document.querySelectorAll('.ex');
350     for (var i = 0, c = examples.length; i < c; i++) {
351         el = examples[i];
352         el.style.display = 'none';
353     }
354 }
355 </script>
356 <script src="../resources/js-test-post.js"></script>
357 </body>
358 </html>