Update device orientation & motion permission native SPI as per latest proposal
[WebKit-https.git] / LayoutTests / accessibility / table-incorrect-colspan-cell.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../resources/js-test-pre.js"></script>
5 </head>
6 <body id="body">
7
8 <table id="table" border="1" cellspacing="1">
9 <tbody><tr><td><table border="1" width="100%"><tbody>
10 <tr><td>Home</td>
11 <td>Help</td>
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>
16 </tr></tbody></table>
17
18
19 <p id="description"></p>
20 <div id="console"></div>
21
22 <script>
23
24     description("This tests the rowRange and columnRange attributes of table cells in a table with colspans that are invalid.");
25
26     function parseRangeString(string) {
27        string = string.replace(/({|})/, "");
28        var nums = string.split(",");
29        return new Array(parseInt(nums[0]), parseInt(nums[1]));
30     }
31
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)
41                     continue;
42
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)
52                             continue;
53
54                         var same = tableCell.isEqual(testTableCell);
55                         var passed = same ? "PASSED" : "FAILED";
56                         debug("\t" + passed + " Cell is same cell at (" + subrow + ", " + subcol + ")");
57                     }
58                 }
59             }
60         }
61     }
62
63 </script>
64
65 <script src="../resources/js-test-post.js"></script>
66 </body>
67 </html>