|
1 <?xml version="1.0"?> |
|
2 |
|
3 <!-- |
|
4 This XML file is used to create sequence of accessible name tests. It consist |
|
5 of two sections. The first section 'ruledfn' declares name computation rules. |
|
6 The second section 'rulesample' defines markup samples we need to check name |
|
7 computation rules for. |
|
8 |
|
9 <ruledfn> |
|
10 <ruleset> |
|
11 <rule> |
|
12 |
|
13 Section 'ruledfn' contains 'ruleset' elements. Every 'ruleset' element is |
|
14 presented by 'rule' elements so that sequence of 'rule' elements gives the |
|
15 sequence of name computations rules. Every 'rule' element can be one of four |
|
16 types. |
|
17 |
|
18 * <rule attr='' type='string'/> used when name is equal to the value of |
|
19 attribute presented on the element. |
|
20 |
|
21 Example, 'aria-label' attribute. In this case 'rule' element has 'attr' |
|
22 attribute pointing to attribute name and 'type' attribute with 'string' |
|
23 value. For example, <rule attr="aria-label" type="string"/>. |
|
24 |
|
25 * <rule attr='' type='ref'/> used when name is calculated from elements that |
|
26 are pointed to by attribute value on the element. |
|
27 |
|
28 Example is 'aria-labelledby'. In this case 'rule' element has 'attr' |
|
29 attribute holding the sequence of IDs of elements used to compute the name, |
|
30 in addition the 'rule' element has 'type' attribute with 'ref' value. |
|
31 For example, <rule attr="aria-labelledby" type="ref"/>. |
|
32 |
|
33 * <rule elm='' elmattr=''/> used when name is calculated from another |
|
34 element. These attributes are used to find an element by tagname and |
|
35 attribute with value equaled to ID of the element. If 'elmattr' is missed |
|
36 then element from subtree with the given tagname is used. |
|
37 |
|
38 Example, html:label@for element, <rule elm="label" elmattr="for"/>. |
|
39 Example, html:caption element, <rule elm="caption"/> |
|
40 |
|
41 * <rule fromsubtree='true'/> used when name is computed from subtree. |
|
42 |
|
43 Example, html:button. In this case 'rule' element has 'fromsubtree' |
|
44 attribute with 'true' value. |
|
45 |
|
46 <rulesample> |
|
47 <markup ruleset=''> |
|
48 |
|
49 Section 'rulesample' provides set of markup samples ('markup' elements). Every |
|
50 'markup' element contains an element that accessible name will be computed for |
|
51 (let's call it test element). In addition the 'markup' element contains some |
|
52 other elements from native markup used in name calculation process for test |
|
53 element. Test element is pointed to by 'ref' attribute on 'markup' element. |
|
54 Also 'markup' element has 'ruleset' attribute to indicate ruleset for the test |
|
55 element. |
|
56 |
|
57 How does it work? Let's consider simple example: |
|
58 <ruledfn> |
|
59 <ruleset id="aria"> |
|
60 <rule attr="aria-label" type="string"/> |
|
61 <rule attr="aria-labelledby" type="ref"/> |
|
62 </ruleset> |
|
63 </ruledfn> |
|
64 <rulesample> |
|
65 <markup ref="html:div" ruleset="aria"> |
|
66 <html:span id="label" textequiv="test2">test2</html:span> |
|
67 <html:div aria-label="test1" |
|
68 aria-labelledby="label">it's a div</html:div> |
|
69 </markup> |
|
70 </rulesample> |
|
71 |
|
72 Initially 'markup' element holds markup for all rules specified by 'ruleset' |
|
73 attribute. This allows us to check if the sequence of name computation rules |
|
74 is correct. Here 'ruleset' element defines two rules. We get the first rule |
|
75 which means accesible name is computed from value of 'aria-label' attribute. |
|
76 Then we check accessible name for the test element and remove 'aria-label' |
|
77 attribute. After we get the second rule which means we should get IDs from |
|
78 'aria-labelledby' attribute and compose accessible name from values of |
|
79 'textequiv' attributes (that are supposed to give the desired name for each |
|
80 element that is being pointed to by aria-labelledby). Check accessible name |
|
81 and finish test. |
|
82 --> |
|
83 |
|
84 <rules xmlns:html="http://www.w3.org/1999/xhtml" |
|
85 xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> |
|
86 |
|
87 <ruledfn> |
|
88 |
|
89 <!-- bricks --> |
|
90 <ruleset id="ARIA"> |
|
91 <rule attr="aria-labelledby" type="ref"/> |
|
92 <rule attr="aria-label" type="string"/> |
|
93 </ruleset> |
|
94 |
|
95 <ruleset id="HTMLElm:Head"> |
|
96 <ruleset ref="ARIA"/> |
|
97 <rule elm="label" elmattr="for"/> |
|
98 </ruleset> |
|
99 |
|
100 <!-- general --> |
|
101 <ruleset id="HTMLControl"> |
|
102 <ruleset ref="ARIA"/> |
|
103 <rule elm="label" elmattr="for"/> |
|
104 <rule fromsubtree="true"/> |
|
105 <rule attr="title" type="string"/> |
|
106 </ruleset> |
|
107 |
|
108 <ruleset id="HTMLElm"> |
|
109 <ruleset ref="HTMLElm:Head"/> |
|
110 <rule attr="title" type="string"/> |
|
111 </ruleset> |
|
112 |
|
113 <!-- specific --> |
|
114 <ruleset id="HTMLInputButton"> |
|
115 <ruleset ref="HTMLElm:Head"/> |
|
116 <rule attr="value" type="string" explict-name="false" reordered="true"/> |
|
117 <rule attr="title" type="string"/> |
|
118 </ruleset> |
|
119 |
|
120 <ruleset id="HTMLInputSubmit" defaultName="Submit Query"> |
|
121 <ruleset ref="HTMLElm:Head"/> |
|
122 <rule attr="value" type="string" explict-name="false" textchanged="true"/> |
|
123 </ruleset> |
|
124 |
|
125 <ruleset id="HTMLInputReset" defaultName="Reset"> |
|
126 <ruleset ref="HTMLElm:Head"/> |
|
127 <rule attr="value" type="string" explict-name="false" textchanged="true"/> |
|
128 </ruleset> |
|
129 |
|
130 <ruleset id="HTMLInputImage"> |
|
131 <ruleset ref="HTMLElm:Head"/> |
|
132 <rule attr="alt" type="string" recreated="true"/> |
|
133 <rule attr="value" type="string" recreated="true"/> |
|
134 <rule attr="title" type="string"/> |
|
135 </ruleset> |
|
136 |
|
137 <ruleset id="HTMLInputImageNoValidSrc" defaultName="Submit Query"> |
|
138 <ruleset ref="HTMLElm:Head"/> |
|
139 <rule attr="alt" type="string" explict-name="false" recreated="true"/> |
|
140 <rule attr="value" type="string" explict-name="false" recreated="true"/> |
|
141 </ruleset> |
|
142 |
|
143 <ruleset id="HTMLOption"> |
|
144 <ruleset ref="ARIA"/> |
|
145 <rule attr="label" type="string"/> |
|
146 <rule fromsubtree="true"/> |
|
147 <rule attr="title" type="string"/> |
|
148 </ruleset> |
|
149 |
|
150 <ruleset id="HTMLImg"> |
|
151 <ruleset ref="ARIA"/> |
|
152 <rule attr="alt" type="string"/> |
|
153 <rule attr="title" type="string"/> |
|
154 </ruleset> |
|
155 |
|
156 <ruleset id="HTMLImgEmptyAlt"> |
|
157 <ruleset ref="ARIA"/> |
|
158 <rule attr="title" type="string"/> |
|
159 <rule attr="alt" type="string"/> |
|
160 </ruleset> |
|
161 |
|
162 <ruleset id="HTMLTable"> |
|
163 <ruleset ref="HTMLElm:Head"/> |
|
164 <rule elm="caption"/> |
|
165 <rule attr="summary" type="string"/> |
|
166 <rule attr="title" type="string"/> |
|
167 </ruleset> |
|
168 </ruledfn> |
|
169 |
|
170 <rulesample> |
|
171 |
|
172 <markup id="HTMLButtonTest" |
|
173 ref="html:button" ruleset="HTMLControl"> |
|
174 <html:span id="l1" textequiv="test2">test2</html:span> |
|
175 <html:span id="l2" textequiv="test3">test3</html:span> |
|
176 <html:label for="btn" textequiv="test4">test4</html:label> |
|
177 <html:button id="btn" |
|
178 aria-label="test1" |
|
179 aria-labelledby="l1 l2" |
|
180 title="test5" |
|
181 textequiv="press me">press me</html:button> |
|
182 </markup> |
|
183 |
|
184 <markup id="HTMLInputButtonTest" |
|
185 ref="html:input" ruleset="HTMLInputButton"> |
|
186 <html:span id="l1" textequiv="test2">test2</html:span> |
|
187 <html:span id="l2" textequiv="test3">test3</html:span> |
|
188 <html:label for="btn" textequiv="test4">test4</html:label> |
|
189 <html:input id="btn" |
|
190 type="button" |
|
191 aria-label="test1" |
|
192 aria-labelledby="l1 l2" |
|
193 value="name from value" |
|
194 alt="no name from al" |
|
195 src="no name from src" |
|
196 data="no name from data" |
|
197 title="name from title"/> |
|
198 </markup> |
|
199 |
|
200 <markup id="HTMLInputSubmitTest" |
|
201 ref="html:input" ruleset="HTMLInputSubmit"> |
|
202 <html:span id="l1" textequiv="test2">test2</html:span> |
|
203 <html:span id="l2" textequiv="test3">test3</html:span> |
|
204 <html:label for="btn-submit" textequiv="test4">test4</html:label> |
|
205 <html:input id="btn-submit" |
|
206 type="submit" |
|
207 aria-label="test1" |
|
208 aria-labelledby="l1 l2" |
|
209 value="name from value" |
|
210 alt="no name from atl" |
|
211 src="no name from src" |
|
212 data="no name from data" |
|
213 title="no name from title"/> |
|
214 </markup> |
|
215 |
|
216 <markup id="HTMLInputResetTest" |
|
217 ref="html:input" ruleset="HTMLInputReset"> |
|
218 <html:span id="l1" textequiv="test2">test2</html:span> |
|
219 <html:span id="l2" textequiv="test3">test3</html:span> |
|
220 <html:label for="btn-reset" textequiv="test4">test4</html:label> |
|
221 <html:input id="btn-reset" |
|
222 type="reset" |
|
223 aria-label="test1" |
|
224 aria-labelledby="l1 l2" |
|
225 value="name from value" |
|
226 alt="no name from alt" |
|
227 src="no name from src" |
|
228 data="no name from data" |
|
229 title="no name from title"/> |
|
230 </markup> |
|
231 |
|
232 <markup id="HTMLInputImageTest" |
|
233 ref="html:input" ruleset="HTMLInputImage"> |
|
234 <html:span id="l1" textequiv="test2">test2</html:span> |
|
235 <html:span id="l2" textequiv="test3">test3</html:span> |
|
236 <html:label for="btn-image" textequiv="test4">test4</html:label> |
|
237 <html:input id="btn-image" |
|
238 type="image" |
|
239 aria-label="test1" |
|
240 aria-labelledby="l1 l2" |
|
241 alt="name from alt" |
|
242 value="name from value" |
|
243 src="../moz.png" |
|
244 data="no name from data" |
|
245 title="name from title"/> |
|
246 </markup> |
|
247 |
|
248 <markup id="HTMLInputImageNoValidSrcTest" |
|
249 ref="html:input" ruleset="HTMLInputImageNoValidSrc"> |
|
250 <html:span id="l1" textequiv="test2">test2</html:span> |
|
251 <html:span id="l2" textequiv="test3">test3</html:span> |
|
252 <html:label for="btn-image" textequiv="test4">test4</html:label> |
|
253 <html:input id="btn-image" |
|
254 type="image" |
|
255 aria-label="test1" |
|
256 aria-labelledby="l1 l2" |
|
257 alt="name from alt" |
|
258 value="name from value" |
|
259 data="no name from data" |
|
260 title="no name from title"/> |
|
261 </markup> |
|
262 |
|
263 <markup id="HTMLOptionTest" |
|
264 ref="html:select/html:option[1]" ruleset="HTMLOption"> |
|
265 <html:span id="l1" textequiv="test2">test2</html:span> |
|
266 <html:span id="l2" textequiv="test3">test3</html:span> |
|
267 <html:select> |
|
268 <html:option id="opt" |
|
269 aria-label="test1" |
|
270 aria-labelledby="l1 l2" |
|
271 label="test4" |
|
272 title="test5" |
|
273 textequiv="option1">option1</html:option> |
|
274 <html:option>option2</html:option> |
|
275 </html:select> |
|
276 </markup> |
|
277 |
|
278 <markup id="HTMLImageTest" |
|
279 ref="html:img" ruleset="HTMLImg"> |
|
280 <html:span id="l1" textequiv="test2">test2</html:span> |
|
281 <html:span id="l2" textequiv="test3">test3</html:span> |
|
282 <html:img id="img" |
|
283 aria-label="Logo of Mozilla" |
|
284 aria-labelledby="l1 l2" |
|
285 alt="Mozilla logo" |
|
286 title="This is a logo" |
|
287 src="../moz.png"/> |
|
288 </markup> |
|
289 |
|
290 <markup id="HTMLImageEmptyAltTest" |
|
291 ref="html:img" ruleset="HTMLImgEmptyAlt"> |
|
292 <html:span id="l1" textequiv="test2">test2</html:span> |
|
293 <html:span id="l2" textequiv="test3">test3</html:span> |
|
294 <html:img id="imgemptyalt" |
|
295 aria-label="Logo of Mozilla" |
|
296 aria-labelledby="l1 l2" |
|
297 title="This is a logo" |
|
298 alt="" |
|
299 src="../moz.png"/> |
|
300 </markup> |
|
301 |
|
302 <markup id="HTMLTdTest" |
|
303 ref="html:table/html:tr/html:td" ruleset="HTMLElm"> |
|
304 <html:span id="l1" textequiv="test2">test2</html:span> |
|
305 <html:span id="l2" textequiv="test3">test3</html:span> |
|
306 <html:label for="tc" textequiv="test4">test4</html:label> |
|
307 <html:table> |
|
308 <html:tr> |
|
309 <html:td id="tc" |
|
310 aria-label="test1" |
|
311 aria-labelledby="l1 l2" |
|
312 title="test5"> |
|
313 <html:p>This is a paragraph</html:p> |
|
314 <html:a href="#">This is a link</html:a> |
|
315 <html:ul> |
|
316 <html:li>This is a list</html:li> |
|
317 </html:ul> |
|
318 </html:td> |
|
319 </html:tr> |
|
320 </html:table> |
|
321 </markup> |
|
322 |
|
323 <markup id="HTMLTdARIAGridCellTest" |
|
324 ref="html:table/html:tr/html:td" ruleset="HTMLControl"> |
|
325 <html:span id="l1" textequiv="test2">test2</html:span> |
|
326 <html:span id="l2" textequiv="test3">test3</html:span> |
|
327 <html:label for="gc" textequiv="test4">test4</html:label> |
|
328 <html:table> |
|
329 <html:tr> |
|
330 <html:td id="gc" |
|
331 role="gridcell" |
|
332 aria-label="test1" |
|
333 aria-labelledby="l1 l2" |
|
334 textequiv="This is a paragraph This is a link • Listitem1 • Listitem2" |
|
335 title="This is a paragraph This is a link This is a list"> |
|
336 <html:p>This is a paragraph</html:p> |
|
337 <html:a href="#">This is a link</html:a> |
|
338 <html:ul> |
|
339 <html:li>Listitem1</html:li> |
|
340 <html:li>Listitem2</html:li> |
|
341 </html:ul> |
|
342 </html:td> |
|
343 </html:tr> |
|
344 </html:table> |
|
345 </markup> |
|
346 |
|
347 <markup id="HTMLTableTest" |
|
348 ref="html:table" ruleset="HTMLTable"> |
|
349 <html:span id="l1" textequiv="lby_tst6_1">lby_tst6_1</html:span> |
|
350 <html:span id="l2" textequiv="lby_tst6_2">lby_tst6_2</html:span> |
|
351 <html:label for="t" textequiv="label_tst6">label_tst6</html:label> |
|
352 <!-- layout frame are recreated due to varous reasons, here's text frame |
|
353 placed after caption frame triggres table frame recreation when |
|
354 caption element is removed from DOM; get rid text node after caption |
|
355 node to make the test working --> |
|
356 <html:table id="t" aria-label="arialabel_tst6" |
|
357 aria-labelledby="l1 l2" |
|
358 summary="summary_tst6" |
|
359 title="title_tst6"> |
|
360 <html:caption textequiv="caption_tst6">caption_tst6</html:caption><html:tr> |
|
361 <html:td>cell1</html:td> |
|
362 <html:td>cell2</html:td> |
|
363 </html:tr> |
|
364 </html:table> |
|
365 </markup> |
|
366 |
|
367 </rulesample> |
|
368 </rules> |