2008-03-29 20:50:31 -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">
|
|
|
|
<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/tests/SimpleTest/SimpleTest.js"></script>
|
|
|
|
|
|
|
|
<script type="application/javascript"
|
2010-09-01 15:09:56 -07:00
|
|
|
src="../common.js"></script>
|
2009-03-05 04:55:54 -08:00
|
|
|
<script type="application/javascript"
|
2010-09-01 15:09:56 -07:00
|
|
|
src="../role.js"></script>
|
2009-03-05 04:55:54 -08:00
|
|
|
|
2008-03-29 20:50:31 -07:00
|
|
|
<script type="text/javascript">
|
|
|
|
|
|
|
|
function doTest()
|
|
|
|
{
|
|
|
|
// Test table with role=alert.
|
|
|
|
var tableInterfaceExposed = true;
|
2009-03-05 04:55:54 -08:00
|
|
|
var accTable3 = getAccessible("table3", [nsIAccessibleTable], null, DONOTFAIL_IF_NO_INTERFACE);
|
|
|
|
if (!accTable3)
|
|
|
|
tableInterfaceExposed = false;
|
2008-03-29 20:50:31 -07:00
|
|
|
ok(tableInterfaceExposed, "table interface is not exposed");
|
|
|
|
|
|
|
|
if (tableInterfaceExposed) {
|
2009-03-05 04:55:54 -08:00
|
|
|
testRole(accTable3, ROLE_ALERT);
|
2008-03-29 20:50:31 -07:00
|
|
|
|
2009-09-10 18:07:56 -07:00
|
|
|
is(accTable3.getCellAt(0,0).firstChild.name, "cell0", "wrong cell");
|
|
|
|
is(accTable3.getCellAt(0,1).firstChild.name, "cell1", "wrong cell");
|
2008-03-29 20:50:31 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
// Test table with role=log and aria property in tr. We create accessible for
|
|
|
|
// tr in this case.
|
|
|
|
tableInterfaceExposed = true;
|
2009-03-05 04:55:54 -08:00
|
|
|
var accTable4 = getAccessible("table4", [nsIAccessibleTable], null, DONOTFAIL_IF_NO_INTERFACE);
|
|
|
|
if (!accTable4)
|
2008-03-29 20:50:31 -07:00
|
|
|
tableInterfaceExposed = false;
|
|
|
|
ok(tableInterfaceExposed, "table interface is not exposed");
|
|
|
|
|
|
|
|
if (tableInterfaceExposed) {
|
2009-03-05 04:55:54 -08:00
|
|
|
accNotCreated = (!isAccessible("tr"));
|
2008-03-29 20:50:31 -07:00
|
|
|
ok(!accNotCreated, "missed tr accessible");
|
|
|
|
|
2009-06-11 11:18:24 -07:00
|
|
|
testRole(accTable4, ROLE_TABLE);
|
2008-03-29 20:50:31 -07:00
|
|
|
|
2009-09-10 18:07:56 -07:00
|
|
|
is(accTable4.getCellAt(0,0).firstChild.name, "cell0", "wrong cell");
|
|
|
|
is(accTable4.getCellAt(0,1).firstChild.name, "cell1", "wrong cell");
|
|
|
|
is(accTable4.getCellAt(1,0).firstChild.name, "cell2", "wrong cell");
|
|
|
|
is(accTable4.getCellAt(1,1).firstChild.name, "cell3", "wrong cell");
|
2008-03-29 20:50:31 -07:00
|
|
|
}
|
|
|
|
|
2010-08-12 08:59:40 -07:00
|
|
|
// test crazy table
|
|
|
|
var table6 = getAccessible("table6", [nsIAccessibleTable]);
|
|
|
|
ok(!table6.getCellAt(0, 0),
|
|
|
|
"We don't expect cell accessible for crazy table 6!");
|
|
|
|
|
2008-03-29 20:50:31 -07:00
|
|
|
SimpleTest.finish();
|
|
|
|
}
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
2009-09-23 07:21:47 -07:00
|
|
|
addA11yLoadEvent(doTest);
|
2008-03-29 20:50:31 -07:00
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
|
|
|
|
<body >
|
|
|
|
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=419811">Mozilla Bug 419811</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="table3" border="1" role="alert">
|
|
|
|
<tr>
|
|
|
|
<td>cell0</td>
|
|
|
|
<td>cell1</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<table id="table4" border="1" role="log">
|
|
|
|
<tr aria-live="polite" id="tr">
|
|
|
|
<td>cell0</td>
|
|
|
|
<td>cell1</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>cell2</td>
|
|
|
|
<td>cell3</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
2008-05-03 22:39:20 -07:00
|
|
|
|
2010-08-12 08:59:40 -07:00
|
|
|
<div style="display:table;" id="table6">
|
|
|
|
<input type="checkbox">
|
|
|
|
<a href="bar">Bad checkbox</a>
|
|
|
|
</div>
|
|
|
|
|
2008-03-29 20:50:31 -07:00
|
|
|
</center>
|
|
|
|
</body>
|
|
|
|
</html>
|