2008-02-23 03:34:39 -08:00
|
|
|
<!DOCTYPE HTML PUBLIC "-//w3c//dtd html 4.0 transitional//en">
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
|
|
|
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
|
2009-03-05 04:55:54 -08:00
|
|
|
<script type="application/javascript"
|
|
|
|
src="chrome://mochikit/content/MochiKit/packed.js"></script>
|
|
|
|
<script type="application/javascript"
|
|
|
|
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
|
|
|
|
|
|
|
<script type="application/javascript"
|
|
|
|
src="chrome://mochikit/content/a11y/accessible/common.js"></script>
|
|
|
|
|
2008-02-23 03:34:39 -08:00
|
|
|
<script type="application/javascript">
|
|
|
|
|
|
|
|
function doTest()
|
|
|
|
{
|
2009-03-05 04:55:54 -08:00
|
|
|
var accTable = getAccessible("table", [nsIAccessibleTable]);
|
2008-02-23 03:34:39 -08:00
|
|
|
|
|
|
|
var s = window.getSelection();
|
|
|
|
if (s.rangeCount > 0)
|
|
|
|
s.removeAllRanges();
|
|
|
|
|
2009-03-05 04:55:54 -08:00
|
|
|
var cell = getNode("col2b");
|
2008-02-23 03:34:39 -08:00
|
|
|
var range = document.createRange();
|
|
|
|
range.selectNode(cell);
|
|
|
|
s.addRange(range);
|
|
|
|
|
2009-09-10 18:07:56 -07:00
|
|
|
is(accTable.selectedCellCount, 1, "only one cell selected");
|
2009-03-05 04:55:54 -08:00
|
|
|
cell = getNode("col2a");
|
2008-02-23 03:34:39 -08:00
|
|
|
range.selectNode(cell);
|
|
|
|
s.addRange(range);
|
2009-03-05 04:55:54 -08:00
|
|
|
cell = getNode("col2c");
|
2008-02-23 03:34:39 -08:00
|
|
|
range.selectNode(cell);
|
|
|
|
s.addRange(range);
|
2009-09-10 20:31:19 -07:00
|
|
|
is(accTable.selectedColumnCount, 1, "only one column selected");
|
2009-03-05 04:55:54 -08:00
|
|
|
cell = getNode("row2a");
|
2008-02-23 03:34:39 -08:00
|
|
|
range.selectNode(cell);
|
|
|
|
s.addRange(range);
|
2009-03-05 04:55:54 -08:00
|
|
|
cell = getNode("row2b");
|
2008-02-23 03:34:39 -08:00
|
|
|
range.selectNode(cell);
|
|
|
|
s.addRange(range);
|
2009-03-05 04:55:54 -08:00
|
|
|
cell = getNode("row2c");
|
2008-02-23 03:34:39 -08:00
|
|
|
range.selectNode(cell);
|
|
|
|
s.addRange(range);
|
|
|
|
|
2009-09-10 20:31:19 -07:00
|
|
|
is(accTable.selectedRowCount, 1, "no cells selected");
|
2008-02-23 03:34:39 -08:00
|
|
|
|
|
|
|
var columnDescription;
|
|
|
|
works = true;
|
|
|
|
try{
|
|
|
|
columnDescription = accTable.getColumnDescription(1);
|
|
|
|
}
|
|
|
|
catch (e) {
|
|
|
|
works = false;
|
|
|
|
}
|
|
|
|
todo(works, "columnDescription should not throw");
|
|
|
|
|
|
|
|
var rowDescription;
|
|
|
|
works = true;
|
|
|
|
try {
|
|
|
|
rowDescription = accTable.getRowDescription(1);
|
|
|
|
}
|
|
|
|
catch (e) {
|
|
|
|
works = false;
|
|
|
|
}
|
|
|
|
todo(works, "rowDescription should not throw");
|
|
|
|
SimpleTest.finish();
|
|
|
|
}
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
2009-09-23 07:21:47 -07:00
|
|
|
addA11yLoadEvent(doTest);
|
2008-02-23 03:34:39 -08:00
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body >
|
|
|
|
|
|
|
|
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=410052">Mozilla Bug 410052</a>
|
|
|
|
<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 id="table" border="1"
|
|
|
|
summary="this is a test table for nsIAccessibleTable" >
|
|
|
|
<caption>Test Table</caption>
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th></th>
|
|
|
|
<th>columnHeader_1</th>
|
|
|
|
<th id ="col2a">columnHeader_2</th>
|
|
|
|
<th>columnHeader_3</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tr>
|
|
|
|
<th id="row2a">rowHeader_1</th>
|
|
|
|
<td id="row2b">row1_column1</td>
|
|
|
|
<td id ="col2b">row1_column2</td>
|
|
|
|
<td id="row2c">row1_column3</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<th>rowHeader_2</th>
|
|
|
|
<td>row2_column1</td>
|
|
|
|
<td id ="col2c">row2_column2</td>
|
|
|
|
<td>row2_column3</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</center>
|
|
|
|
</body>
|
|
|
|
</html>
|