1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
4 <script src="../resources/js-test-pre.js"></script>
8 <table id="table" border="1" cellspacing="1">
9 <tbody><tr><td><table border="1" width="100%"><tbody>
12 <td>Login</td></tr></tbody></table>
13 </td></tr><tr><td colspan="4">
14 <input type="text"></td>
15 <td colspan="2" id="tablecell">Tip us on news</td>
19 <p id="description"></p>
20 <div id="console"></div>
24 description("This tests the rowRange and columnRange attributes of table cells in a table with colspans that are invalid.");
26 function parseRangeString(string) {
27 string = string.replace(/({|})/, "");
28 var nums = string.split(",");
29 return new Array(parseInt(nums[0]), parseInt(nums[1]));
32 if (window.accessibilityController) {
33 var table = accessibilityController.accessibleElementById("table");
34 var rowCount = table.rowCount;
35 var columnCount = table.columnCount;
36 debug("Table: Rows: " + rowCount + ", Columns: " + columnCount);
37 for (var row = 0; row < rowCount; row++) {
38 for (var col = 0; col < columnCount; col++) {
39 var tableCell = table.cellForColumnAndRow(col, row);
40 if (!tableCell || !tableCell.isValid)
43 var rowIndexRange = tableCell.rowIndexRange();
44 var colIndexRange = tableCell.columnIndexRange();
45 debug("[Table cell at row: " + row + ", column: " + col + "] Row range: " + rowIndexRange + ", Column range: " + colIndexRange);
46 var rowInfo = parseRangeString(rowIndexRange);
47 var colInfo = parseRangeString(colIndexRange);
48 for (var subrow = rowInfo[0]; subrow < rowInfo[0] + rowInfo[1]; subrow++) {
49 for (var subcol = colInfo[0]; subcol < colInfo[0] + colInfo[1]; subcol++) {
50 var testTableCell = table.cellForColumnAndRow(subcol, subrow);
51 if (!testTableCell || !testTableCell.isValid)
54 var same = tableCell.isEqual(testTableCell);
55 var passed = same ? "PASSED" : "FAILED";
56 debug("\t" + passed + " Cell is same cell at (" + subrow + ", " + subcol + ")");
65 <script src="../resources/js-test-post.js"></script>