|
1 <!DOCTYPE HTML PUBLIC "-//w3c//dtd html 4.0 transitional//en"> |
|
2 <html> |
|
3 <head> |
|
4 <meta http-equiv="content-type" content="text/html; charset=UTF-8"> |
|
5 <title>nsIAccesible selection methods testing for HTML table</title> |
|
6 <link rel="stylesheet" type="text/css" |
|
7 href="chrome://mochikit/content/tests/SimpleTest/test.css" /> |
|
8 |
|
9 <script type="application/javascript" |
|
10 src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> |
|
11 |
|
12 <script type="application/javascript" |
|
13 src="../common.js"></script> |
|
14 <script type="application/javascript" |
|
15 src="../role.js"></script> |
|
16 <script type="application/javascript" |
|
17 src="../states.js"></script> |
|
18 <script type="application/javascript" |
|
19 src="../table.js"></script> |
|
20 |
|
21 <script type="text/javascript"> |
|
22 |
|
23 function doTest() |
|
24 { |
|
25 ////////////////////////////////////////////////////////////////////////// |
|
26 // table |
|
27 |
|
28 var cellsArray = |
|
29 [ |
|
30 [false, false, false, kColSpanned, false, false, false, false], |
|
31 [false, false, false, false, false, false, false, kRowSpanned], |
|
32 [false, false, kColSpanned, false, false, false, false, kRowSpanned], |
|
33 [false, kRowSpanned, kSpanned, false, false, kRowSpanned, false, kRowSpanned] |
|
34 ]; |
|
35 |
|
36 testTableSelection("table", cellsArray); |
|
37 |
|
38 var rowCount = 4; |
|
39 for (var rowIdx = 0; rowIdx < rowCount; rowIdx++) |
|
40 testSelectTableRow("table", rowIdx, cellsArray); |
|
41 |
|
42 for (var rowIdx = 0; rowIdx < rowCount; rowIdx++) { |
|
43 testSelectTableRow("table", rowIdx, cellsArray); |
|
44 testUnselectTableRow("table", rowIdx, cellsArray); |
|
45 } |
|
46 |
|
47 var columsCount = 8; |
|
48 for (var colIdx = 0; colIdx < columsCount; colIdx++) |
|
49 testSelectTableColumn("table", colIdx, cellsArray); |
|
50 |
|
51 for (var colIdx = 0; colIdx < columsCount; colIdx++) { |
|
52 testSelectTableColumn("table", colIdx, cellsArray); |
|
53 testUnselectTableColumn("table", colIdx, cellsArray); |
|
54 } |
|
55 |
|
56 var accTable = getAccessible("table", [nsIAccessibleTable]); |
|
57 ok(!accTable.isProbablyForLayout(), "table is not for layout"); |
|
58 |
|
59 ////////////////////////////////////////////////////////////////////////// |
|
60 // table instane |
|
61 |
|
62 cellsArray = |
|
63 [ |
|
64 [false, false, false, -1, -1], |
|
65 [false, false, false, -1, -1], |
|
66 [false, false, kColSpanned, kColSpanned, -1], |
|
67 [kRowSpanned, false, false, -1, -1], |
|
68 [kRowSpanned, false, kRowSpanned, false, false] |
|
69 ]; |
|
70 |
|
71 testTableSelection("tableinsane", cellsArray); |
|
72 |
|
73 SimpleTest.finish(); |
|
74 } |
|
75 |
|
76 SimpleTest.waitForExplicitFinish(); |
|
77 addA11yLoadEvent(doTest); |
|
78 </script> |
|
79 </head> |
|
80 <body> |
|
81 |
|
82 <a target="_blank" |
|
83 href="https://bugzilla.mozilla.org/show_bug.cgi?id=410052" |
|
84 title="Fix our nsHTMLAccessibleTable class so GetIndexAt and GetRowAtIndex and GetColumnAtIndex behave consistently"> |
|
85 Mozilla Bug 410052 |
|
86 </a> |
|
87 <a target="_blank" |
|
88 href="https://bugzilla.mozilla.org/show_bug.cgi?id=501635" |
|
89 title="nsHTMLTableAccessible::GetSelectedCells contains index duplicates for spanned rows or columns"> |
|
90 Mozilla Bug 501635 |
|
91 </a> |
|
92 <a target="_blank" |
|
93 href="https://bugzilla.mozilla.org/show_bug.cgi?id=417929" |
|
94 title="nsIAccessiblTable selectRows does not unselect previously selected rows"> |
|
95 Mozilla Bug 417929 |
|
96 </a> |
|
97 <a target="_blank" |
|
98 href="https://bugzilla.mozilla.org/show_bug.cgi?id=501659" |
|
99 title="HTML table's isRowSelected/isColumnSelected shouldn't fail if row or column has cell holes"> |
|
100 Mozilla Bug 501659 |
|
101 </a> |
|
102 |
|
103 <p id="display"></p> |
|
104 <div id="content" style="display: none"></div> |
|
105 <pre id="test"> |
|
106 </pre> |
|
107 |
|
108 <!-- Test Table --> |
|
109 <br><br><b> Testing Table:</b><br><br> |
|
110 <center> |
|
111 <table cellpadding="2" cellspacing="2" border="1" width="50%" id="table"> |
|
112 <tbody> |
|
113 <tr> |
|
114 <td><br></td> |
|
115 <td><br></td> |
|
116 <td rowspan="1" colspan="2"><br></td> |
|
117 <td><br></td> |
|
118 <td><br></td> |
|
119 <td><br></td> |
|
120 <td rowspan="4" colspan="1"><br></td> |
|
121 </tr> |
|
122 <tr> |
|
123 <td><br></td> |
|
124 <td><br></td> |
|
125 <td><br></td> |
|
126 <td><br></td> |
|
127 <td><br></td> |
|
128 <td><br></td> |
|
129 <td><br></td> |
|
130 </tr> |
|
131 <tr> |
|
132 <td><br></td> |
|
133 <td rowspan="2" colspan="2">c1</td> |
|
134 <td><br></td> |
|
135 <td><br></td> |
|
136 <td rowspan="2" colspan="1"><br></td> |
|
137 <td><br></td> |
|
138 </tr> |
|
139 <tr> |
|
140 <td><br></td> |
|
141 <td><br></td> |
|
142 <td><br></td> |
|
143 <td><br></td> |
|
144 </tr> |
|
145 </tbody> |
|
146 </table> |
|
147 |
|
148 <table border="1" id="tableinsane"> |
|
149 <thead> |
|
150 <tr> |
|
151 <th>col1</th> |
|
152 <th>col2</th> |
|
153 <th>col3</th> |
|
154 </tr> |
|
155 </thead> |
|
156 <tbody> |
|
157 <tr> |
|
158 <td>1</td> |
|
159 <td>2</td> |
|
160 <td>3</td> |
|
161 </tr> |
|
162 <tr> |
|
163 <td rowspan="3">4</td> |
|
164 <td colspan="4">5</td> |
|
165 </tr> |
|
166 <tr> |
|
167 <td>6</td> |
|
168 <td rowspan="2">7</td> |
|
169 </tr> |
|
170 <tr> |
|
171 <td>8</td> |
|
172 <td>9</td> |
|
173 <td>10</td> |
|
174 </tr> |
|
175 </tbody> |
|
176 </table> |
|
177 |
|
178 </center> |
|
179 </body> |
|
180 </html> |