|
1 <!DOCTYPE html> |
|
2 <html> |
|
3 <head> |
|
4 <title>Test Global ARIA States and Accessible Creation</title> |
|
5 <link rel="stylesheet" type="text/css" |
|
6 href="chrome://mochikit/content/tests/SimpleTest/test.css" /> |
|
7 |
|
8 <script type="application/javascript" |
|
9 src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> |
|
10 |
|
11 <script type="application/javascript" |
|
12 src="../common.js"></script> |
|
13 <script type="application/javascript" |
|
14 src="../role.js"></script> |
|
15 |
|
16 <script type="application/javascript"> |
|
17 function doTest() |
|
18 { |
|
19 var globalIds = [ |
|
20 "atomic", |
|
21 "busy", |
|
22 "controls", |
|
23 "describedby", |
|
24 "disabled", |
|
25 "dropeffect", |
|
26 "flowto", |
|
27 "grabbed", |
|
28 "haspopup", |
|
29 "hidden", |
|
30 "invalid", |
|
31 "label", |
|
32 "labelledby", |
|
33 "live", |
|
34 "owns", |
|
35 "relevant" |
|
36 ]; |
|
37 |
|
38 // Elements having ARIA global state or properties or referred by another |
|
39 // element must be accessible. |
|
40 ok(isAccessible("pawn"), |
|
41 "Must be accessible because referred by another element."); |
|
42 |
|
43 for (var idx = 0; idx < globalIds.length; idx++) { |
|
44 ok(isAccessible(globalIds[idx]), |
|
45 "Must be accessible becuase of " + "aria-" + globalIds[idx] + |
|
46 " presence"); |
|
47 } |
|
48 |
|
49 // Unfocusable elements, having ARIA global state or property with a valid |
|
50 // IDREF value, and an inherited presentation role. A generic accessible |
|
51 // is created (to prevent table cells text jamming). |
|
52 ok(!isAccessible("td_nothing", nsIAccessibleTableCell), |
|
53 "inherited presentation role takes a place"); |
|
54 |
|
55 for (var idx = 0; idx < globalIds.length; idx++) { |
|
56 ok(isAccessible("td_" + globalIds[idx]), |
|
57 "Inherited presentation role must be ignored becuase of " + |
|
58 "aria-" + globalIds[idx] + " presence"); |
|
59 } |
|
60 |
|
61 SimpleTest.finish(); |
|
62 } |
|
63 |
|
64 SimpleTest.waitForExplicitFinish(); |
|
65 addA11yLoadEvent(doTest); |
|
66 </script> |
|
67 </head> |
|
68 <body> |
|
69 |
|
70 <a target="_blank" |
|
71 title="Update universal ARIA attribute support to latest spec" |
|
72 href="https://bugzilla.mozilla.org/show_bug.cgi?id=551978"> |
|
73 Mozilla Bug 551978 |
|
74 </a> |
|
75 <a target="_blank" |
|
76 title="Presentational table related elements referred or having global ARIA attributes must be accessible" |
|
77 href="https://bugzilla.mozilla.org/show_bug.cgi?id=809751"> |
|
78 Mozilla Bug 809751 |
|
79 </a> |
|
80 <p id="display"></p> |
|
81 <div id="content" style="display: none"></div> |
|
82 <pre id="test"> |
|
83 </pre> |
|
84 |
|
85 <!-- Test that global aria states and properties are enough to cause the |
|
86 creation of accessible objects --> |
|
87 <div id="global_aria_states_and_props" role="group"> |
|
88 <span id="pawn"></span> |
|
89 <span id="atomic" aria-atomic="true"></span> |
|
90 <span id="busy" aria-busy="false"></span> |
|
91 <span id="controls" aria-controls="pawn"></span> |
|
92 <span id="describedby" aria-describedby="pawn"></span> |
|
93 <span id="disabled" aria-disabled="true"></span> |
|
94 <span id="dropeffect" aria-dropeffect="move"></span> |
|
95 <span id="flowto" aria-flowto="pawn"></span> |
|
96 <span id="grabbed" aria-grabbed="false"></span> |
|
97 <span id="haspopup" aria-haspopup="false"></span> |
|
98 <span id="hidden" aria-hidden="true"></span> |
|
99 <span id="invalid" aria-invalid="false"></span> |
|
100 <span id="label" aria-label="hi"></span> |
|
101 <span id="labelledby" aria-labelledby="label"></span> |
|
102 <span id="live" aria-live="polite"></span> |
|
103 <span id="owns" aria-owns="pawn"></span> |
|
104 <span id="relevant" aria-relevant="additions"></span> |
|
105 </div> |
|
106 |
|
107 <table role="presentation"> |
|
108 <tr> |
|
109 <td id="td_nothing"></td> |
|
110 <td id="td_atomic" aria-atomic="true"></td> |
|
111 <td id="td_busy" aria-busy="false"></td> |
|
112 <td id="td_controls" aria-controls="pawn"></td> |
|
113 <td id="td_describedby" aria-describedby="pawn"></td> |
|
114 <td id="td_disabled" aria-disabled="true"></td> |
|
115 <td id="td_dropeffect" aria-dropeffect="move"></td> |
|
116 <td id="td_flowto" aria-flowto="pawn"></td> |
|
117 <td id="td_grabbed" aria-grabbed="false"></td> |
|
118 <td id="td_haspopup" aria-haspopup="false"></td> |
|
119 <td id="td_hidden" aria-hidden="true"></td> |
|
120 <td id="td_invalid" aria-invalid="false"></td> |
|
121 <td id="td_label" aria-label="hi"></td> |
|
122 <td id="td_labelledby" aria-labelledby="label"></td> |
|
123 <td id="td_live" aria-live="polite"></td> |
|
124 <td id="td_owns" aria-owns="pawn"></td> |
|
125 <td id="td_relevant" aria-relevant="additions"></td> |
|
126 </tr> |
|
127 </table> |
|
128 </body> |
|
129 </html> |