2009-06-12 05:52:29 -07:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<!--
|
|
|
|
https://bugzilla.mozilla.org/show_bug.cgi?id=410052
|
|
|
|
-->
|
|
|
|
<head>
|
2009-07-02 09:06:23 -07:00
|
|
|
<title>nsIAccesible selection methods testing for ARIA grid</title>
|
2009-06-12 05:52:29 -07:00
|
|
|
<link rel="stylesheet" type="text/css"
|
|
|
|
href="chrome://mochikit/content/tests/SimpleTest/test.css" />
|
|
|
|
|
|
|
|
<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>
|
2009-07-01 01:10:15 -07:00
|
|
|
<script type="application/javascript"
|
|
|
|
src="chrome://mochikit/content/a11y/accessible/states.js"></script>
|
2009-06-12 05:52:29 -07:00
|
|
|
<script type="application/javascript"
|
|
|
|
src="chrome://mochikit/content/a11y/accessible/table.js"></script>
|
|
|
|
|
|
|
|
<script type="application/javascript">
|
|
|
|
function doTest()
|
|
|
|
{
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
2009-09-14 20:55:26 -07:00
|
|
|
// ARIA grid
|
2009-06-12 05:52:29 -07:00
|
|
|
var cellsArray =
|
|
|
|
[
|
|
|
|
[ true, true, false, true],
|
|
|
|
[ true, false, true, true],
|
|
|
|
[ true, false, false, true],
|
|
|
|
[ true, true, true, true],
|
|
|
|
[ true, true, true, true]
|
|
|
|
];
|
|
|
|
|
|
|
|
testTableSelection("table", cellsArray);
|
|
|
|
testUnselectTableColumn("table", 3, cellsArray);
|
|
|
|
testUnselectTableRow("table", 3, cellsArray);
|
|
|
|
testSelectTableColumn("table", 0, cellsArray);
|
|
|
|
testSelectTableRow("table", 0, cellsArray);
|
|
|
|
|
2009-09-14 20:55:26 -07:00
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
// a bit crazy ARIA grid
|
|
|
|
cellsArray =
|
|
|
|
[
|
|
|
|
[ false, false],
|
|
|
|
[ false, false]
|
|
|
|
];
|
|
|
|
|
|
|
|
testTableSelection("grid2", cellsArray);
|
|
|
|
testSelectTableColumn("grid2", 0, cellsArray);
|
|
|
|
testSelectTableRow("grid2", 0, cellsArray);
|
|
|
|
testUnselectTableColumn("grid2", 0, cellsArray);
|
|
|
|
testUnselectTableRow("grid2", 0, cellsArray);
|
|
|
|
|
2009-06-12 05:52:29 -07:00
|
|
|
SimpleTest.finish();
|
|
|
|
}
|
|
|
|
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
|
|
|
addA11yLoadEvent(doTest);
|
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
|
|
|
|
<a target="_blank"
|
|
|
|
title="implement nsIAccessibleTable selection methods for ARIA grids"
|
|
|
|
href="https://bugzilla.mozilla.org/show_bug.cgi?id=410052">Mozilla Bug 410052</a>
|
2009-09-14 20:55:26 -07:00
|
|
|
<a target="_blank"
|
|
|
|
title="nsHTMLTableCellAccessible is used in dojo's crazy ARIA grid"
|
|
|
|
href="https://bugzilla.mozilla.org/show_bug.cgi?id=513848">Mozilla Bug 513848</a>
|
|
|
|
|
2009-06-12 05:52:29 -07:00
|
|
|
<p id="display"></p>
|
|
|
|
<div id="content" style="display: none"></div>
|
|
|
|
<pre id="test">
|
|
|
|
</pre>
|
|
|
|
|
|
|
|
<div role="grid" id="table">
|
|
|
|
<div role="row">
|
|
|
|
<span role="gridcell" aria-selected="true">cell1</span>
|
|
|
|
<span role="gridcell" aria-selected="true">cell2</span>
|
|
|
|
<span role="gridcell">cell3</span>
|
|
|
|
<span role="gridcell" aria-selected="true">cell4</span>
|
|
|
|
</div>
|
|
|
|
<div role="row">
|
|
|
|
<span role="gridcell" aria-selected="true">cell5</span>
|
|
|
|
<span role="gridcell">cell6</span>
|
|
|
|
<span role="gridcell" aria-selected="true">cell7</span>
|
|
|
|
<span role="gridcell" aria-selected="true">cell8</span>
|
|
|
|
</div>
|
|
|
|
<div role="row">
|
|
|
|
<span role="gridcell" aria-selected="true">cell9</span>
|
|
|
|
<span role="gridcell">cell10</span>
|
|
|
|
<span role="gridcell">cell11</span>
|
|
|
|
<span role="gridcell" aria-selected="true">cell12</span>
|
|
|
|
</div>
|
|
|
|
<div role="row" aria-selected="true">
|
|
|
|
<span role="gridcell">cell13</span>
|
|
|
|
<span role="gridcell">cell14</span>
|
|
|
|
<span role="gridcell">cell15</span>
|
|
|
|
<span role="gridcell">cell16</span>
|
|
|
|
</div>
|
|
|
|
<div role="row">
|
|
|
|
<span role="gridcell" aria-selected="true">cell17</span>
|
|
|
|
<span role="gridcell" aria-selected="true">cell18</span>
|
|
|
|
<span role="gridcell" aria-selected="true">cell19</span>
|
|
|
|
<span role="gridcell" aria-selected="true">cell20</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2009-09-14 20:55:26 -07:00
|
|
|
<div role="grid" id="grid2">
|
|
|
|
<div role="row">
|
|
|
|
<table role="presentation">
|
|
|
|
<tr>
|
|
|
|
<td role="columnheader">header1</td>
|
|
|
|
<td role="columnheader">header2</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
<div role="row">
|
|
|
|
<table role="presentation">
|
|
|
|
<tr>
|
|
|
|
<td role="gridcell">cell1</td>
|
|
|
|
<td role="gridcell" tabindex="-1">cell2</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2009-06-12 05:52:29 -07:00
|
|
|
</body>
|
|
|
|
</html>
|