blob: a86daed77ef3af76add47d8def338cada713b4cc [file] [log] [blame]
<html>
<script src="../resources/js-test.js"></script>
<body>
<table id="table1">
<caption>table</caption>
<thead>
<tr>
<th>No</th>
<th>Country</th>
<th id="cell1">Capital</th>
</tr>
</thead>
<tbody>
<tr>
<th>1.</th>
<th>Poland</th>
<th >Warsaw</th>
</tr>
<tr>
<th id="cell5">2.</th>
<th id="cell2">Russia</th>
<th>Moscow</th>
</tr>
<tr>
<th>3.</th>
<td>Ukraine</td>
<th id="cell3">Kiev</th>
</tr>
</tbody>
<tfoot>
<tr>
<th id="cell6">All</th>
<th id="cell4">3 countries</th>
<th>3 capitals</th>
</tr>
</tfoot>
</table>
<br>
<br>
<table id="table2">
<caption>table2</caption>
<tr>
<th>No</th>
<th>Country</th>
<th id="cell21">Capital</th>
</tr>
<tr>
<th>1.</th>
<th>Germany</th>
<th>Berlin</th>
</tr>
<tr>
<th id="cell25">2.</th>
<th id="cell22">Sweden</th>
<th>Stockholm</th>
</tr>
<tr>
<th>3.</th>
<td>Norway</td>
<th id="cell23">Oslo</th>
</tr>
</table>
<br>
<br>
<p>This test checks the correctness of roles for different cases of table cells.</p>
<div id="console"></div>
<script>
if (window.accessibilityController) {
var table = accessibilityController.accessibleElementById("table1");
var cell1 = table.cellForColumnAndRow(2, 0);
var role1 = cell1.role;
var cell2 = table.cellForColumnAndRow(1, 2);
var role2 = cell2.role;
var cell3 = table.cellForColumnAndRow(2, 3);
var role3 = cell3.role;
var cell4 = table.cellForColumnAndRow(1, 4);
var role4 = cell4.role;
var cell5 = table.cellForColumnAndRow(0, 2);
var role5 = cell5.role;
var cell6 = table.cellForColumnAndRow(0, 4);
var role6 = cell6.role;
debug("The table cell at (2,0) currently has role " + role1 + " .");
debug("The table cell at (1,2) currently has role " + role2 + " .");
debug("The table cell at (2,3) currently has role " + role3 + " .");
debug("The table cell at (1,4) currently has role " + role4 + " .");
debug("The table cell at (0,2) currently has role " + role5 + " .");
debug("The table cell at (0,4) currently has role " + role6 + " .\n");
var table2 = accessibilityController.accessibleElementById("table2");
var cell21 = table2.cellForColumnAndRow(2, 0);
var role21 = cell21.role;
var cell22 = table2.cellForColumnAndRow(1, 2);
var role22 = cell22.role;
var cell23 = table2.cellForColumnAndRow(2, 3);
var role23 = cell23.role;
var cell25 = table2.cellForColumnAndRow(0, 2);
var role25 = cell25.role;
debug("The table2 cell at (2,0) currently has role " + role21 + " .");
debug("The table2 cell at (1,2) currently has role " + role22 + " .");
debug("The table2 cell at (2,3) currently has role " + role23 + " .");
debug("The table2 cell at (0,2) currently has role " + role25 + " .");
}
</script>
</body>
</html>