2009-07-02 09:06:23 -07:00
|
|
|
<!DOCTYPE HTML PUBLIC "-//w3c//dtd html 4.0 transitional//en">
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
|
|
|
<title>nsIAccesible selection methods testing for HTML table</title>
|
|
|
|
<link rel="stylesheet" type="text/css"
|
|
|
|
href="chrome://mochikit/content/tests/SimpleTest/test.css" />
|
|
|
|
|
|
|
|
<script type="application/javascript"
|
|
|
|
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
|
|
|
|
|
|
|
<script type="application/javascript"
|
2010-09-01 15:09:56 -07:00
|
|
|
src="../common.js"></script>
|
2012-04-04 15:07:49 -07:00
|
|
|
<script type="application/javascript"
|
|
|
|
src="../role.js"></script>
|
2009-07-02 09:06:23 -07:00
|
|
|
<script type="application/javascript"
|
2010-09-01 15:09:56 -07:00
|
|
|
src="../states.js"></script>
|
2009-07-02 09:06:23 -07:00
|
|
|
<script type="application/javascript"
|
2010-09-01 15:09:56 -07:00
|
|
|
src="../table.js"></script>
|
2009-07-02 09:06:23 -07:00
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
|
|
|
function doTest()
|
|
|
|
{
|
2009-10-17 19:38:27 -07:00
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
// table
|
|
|
|
|
2009-07-02 09:06:23 -07:00
|
|
|
var cellsArray =
|
|
|
|
[
|
2009-09-09 20:06:54 -07:00
|
|
|
[false, false, false, kColSpanned, false, false, false, false],
|
|
|
|
[false, false, false, false, false, false, false, kRowSpanned],
|
|
|
|
[false, false, kColSpanned, false, false, false, false, kRowSpanned],
|
|
|
|
[false, kRowSpanned, kSpanned, false, false, kRowSpanned, false, kRowSpanned]
|
2009-07-02 09:06:23 -07:00
|
|
|
];
|
|
|
|
|
|
|
|
testTableSelection("table", cellsArray);
|
|
|
|
|
2009-09-10 18:07:56 -07:00
|
|
|
var rowCount = 4;
|
|
|
|
for (var rowIdx = 0; rowIdx < rowCount; rowIdx++)
|
2009-09-09 20:06:54 -07:00
|
|
|
testSelectTableRow("table", rowIdx, cellsArray);
|
2009-07-02 09:06:23 -07:00
|
|
|
|
2009-09-10 18:07:56 -07:00
|
|
|
for (var rowIdx = 0; rowIdx < rowCount; rowIdx++) {
|
2009-09-09 20:06:54 -07:00
|
|
|
testSelectTableRow("table", rowIdx, cellsArray);
|
|
|
|
testUnselectTableRow("table", rowIdx, cellsArray);
|
2009-07-02 09:06:23 -07:00
|
|
|
}
|
|
|
|
|
2009-09-09 20:06:54 -07:00
|
|
|
var columsCount = 8;
|
|
|
|
for (var colIdx = 0; colIdx < columsCount; colIdx++)
|
|
|
|
testSelectTableColumn("table", colIdx, cellsArray);
|
2009-07-02 09:06:23 -07:00
|
|
|
|
2009-09-09 20:06:54 -07:00
|
|
|
for (var colIdx = 0; colIdx < columsCount; colIdx++) {
|
|
|
|
testSelectTableColumn("table", colIdx, cellsArray);
|
|
|
|
testUnselectTableColumn("table", colIdx, cellsArray);
|
2009-07-02 09:06:23 -07:00
|
|
|
}
|
2009-09-09 20:06:54 -07:00
|
|
|
|
|
|
|
var accTable = getAccessible("table", [nsIAccessibleTable]);
|
2009-07-02 09:06:23 -07:00
|
|
|
ok(!accTable.isProbablyForLayout(), "table is not for layout");
|
2009-09-09 20:06:54 -07:00
|
|
|
|
2009-10-17 19:38:27 -07:00
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
// table instane
|
|
|
|
|
|
|
|
cellsArray =
|
|
|
|
[
|
|
|
|
[false, false, false, -1, -1],
|
|
|
|
[false, false, false, -1, -1],
|
|
|
|
[false, false, kColSpanned, kColSpanned, -1],
|
|
|
|
[kRowSpanned, false, false, -1, -1],
|
|
|
|
[kRowSpanned, false, kRowSpanned, false, false]
|
|
|
|
];
|
|
|
|
|
|
|
|
testTableSelection("tableinsane", cellsArray);
|
|
|
|
|
2009-07-02 09:06:23 -07:00
|
|
|
SimpleTest.finish();
|
|
|
|
}
|
|
|
|
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
2009-09-23 07:21:47 -07:00
|
|
|
addA11yLoadEvent(doTest);
|
2009-07-02 09:06:23 -07:00
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
|
|
|
|
<a target="_blank"
|
|
|
|
href="https://bugzilla.mozilla.org/show_bug.cgi?id=410052"
|
|
|
|
title="Fix our nsHTMLAccessibleTable class so GetIndexAt and GetRowAtIndex and GetColumnAtIndex behave consistently">
|
|
|
|
Mozilla Bug 410052
|
|
|
|
</a>
|
|
|
|
<a target="_blank"
|
|
|
|
href="https://bugzilla.mozilla.org/show_bug.cgi?id=501635"
|
|
|
|
title="nsHTMLTableAccessible::GetSelectedCells contains index duplicates for spanned rows or columns">
|
|
|
|
Mozilla Bug 501635
|
|
|
|
</a>
|
2009-09-09 20:06:54 -07:00
|
|
|
<a target="_blank"
|
|
|
|
href="https://bugzilla.mozilla.org/show_bug.cgi?id=417929"
|
|
|
|
title="nsIAccessiblTable selectRows does not unselect previously selected rows">
|
|
|
|
Mozilla Bug 417929
|
|
|
|
</a>
|
2009-10-17 19:38:27 -07:00
|
|
|
<a target="_blank"
|
|
|
|
href="https://bugzilla.mozilla.org/show_bug.cgi?id=501659"
|
|
|
|
title="HTML table's isRowSelected/isColumnSelected shouldn't fail if row or column has cell holes">
|
|
|
|
Mozilla Bug 501659
|
|
|
|
</a>
|
2009-07-02 09:06:23 -07:00
|
|
|
|
|
|
|
<p id="display"></p>
|
|
|
|
<div id="content" style="display: none"></div>
|
|
|
|
<pre id="test">
|
|
|
|
</pre>
|
|
|
|
|
|
|
|
<!-- Test Table -->
|
|
|
|
<br><br><b> Testing Table:</b><br><br>
|
|
|
|
<center>
|
|
|
|
<table cellpadding="2" cellspacing="2" border="1" width="50%" id="table">
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td><br></td>
|
|
|
|
<td><br></td>
|
|
|
|
<td rowspan="1" colspan="2"><br></td>
|
|
|
|
<td><br></td>
|
|
|
|
<td><br></td>
|
|
|
|
<td><br></td>
|
|
|
|
<td rowspan="4" colspan="1"><br></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td><br></td>
|
|
|
|
<td><br></td>
|
|
|
|
<td><br></td>
|
|
|
|
<td><br></td>
|
|
|
|
<td><br></td>
|
|
|
|
<td><br></td>
|
|
|
|
<td><br></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td><br></td>
|
|
|
|
<td rowspan="2" colspan="2">c1</td>
|
|
|
|
<td><br></td>
|
|
|
|
<td><br></td>
|
|
|
|
<td rowspan="2" colspan="1"><br></td>
|
|
|
|
<td><br></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td><br></td>
|
|
|
|
<td><br></td>
|
|
|
|
<td><br></td>
|
|
|
|
<td><br></td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
2009-10-17 19:38:27 -07:00
|
|
|
|
|
|
|
<table border="1" id="tableinsane">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>col1</th>
|
|
|
|
<th>col2</th>
|
|
|
|
<th>col3</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td>1</td>
|
|
|
|
<td>2</td>
|
|
|
|
<td>3</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td rowspan="3">4</td>
|
|
|
|
<td colspan="4">5</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>6</td>
|
|
|
|
<td rowspan="2">7</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>8</td>
|
|
|
|
<td>9</td>
|
|
|
|
<td>10</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
2009-07-02 09:06:23 -07:00
|
|
|
</center>
|
|
|
|
</body>
|
|
|
|
</html>
|