accessible/tests/mochitest/table/test_table_1.html

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 <!DOCTYPE HTML PUBLIC "-//w3c//dtd html 4.0 transitional//en">
michael@0 2 <html>
michael@0 3 <head>
michael@0 4 <meta http-equiv="content-type" content="text/html; charset=UTF-8">
michael@0 5 <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
michael@0 6 <script type="application/javascript"
michael@0 7 src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
michael@0 8
michael@0 9 <script type="application/javascript"
michael@0 10 src="../common.js"></script>
michael@0 11
michael@0 12 <script type="application/javascript">
michael@0 13
michael@0 14 function doTest()
michael@0 15 {
michael@0 16 var accTable = getAccessible("table", [nsIAccessibleTable]);
michael@0 17
michael@0 18 var s = window.getSelection();
michael@0 19 if (s.rangeCount > 0)
michael@0 20 s.removeAllRanges();
michael@0 21
michael@0 22 var cell = getNode("col2b");
michael@0 23 var range = document.createRange();
michael@0 24 range.selectNode(cell);
michael@0 25 s.addRange(range);
michael@0 26
michael@0 27 is(accTable.selectedCellCount, 1, "only one cell selected");
michael@0 28 cell = getNode("col2a");
michael@0 29 range = document.createRange();
michael@0 30 range.selectNode(cell);
michael@0 31 s.addRange(range);
michael@0 32 cell = getNode("col2c");
michael@0 33 range = document.createRange();
michael@0 34 range.selectNode(cell);
michael@0 35 s.addRange(range);
michael@0 36 is(accTable.selectedColumnCount, 1, "only one column selected");
michael@0 37
michael@0 38 cell = getNode("row2a");
michael@0 39 range = document.createRange();
michael@0 40 range.selectNode(cell);
michael@0 41 s.addRange(range);
michael@0 42 cell = getNode("row2b");
michael@0 43 range = document.createRange();
michael@0 44 range.selectNode(cell);
michael@0 45 s.addRange(range);
michael@0 46 range = document.createRange();
michael@0 47 cell = getNode("row2c");
michael@0 48 range.selectNode(cell);
michael@0 49 s.addRange(range);
michael@0 50
michael@0 51 is(accTable.selectedRowCount, 1, "no cells selected");
michael@0 52
michael@0 53 var columnDescription = accTable.getColumnDescription(1);
michael@0 54 var rowDescription = accTable.getRowDescription(1);
michael@0 55
michael@0 56 SimpleTest.finish();
michael@0 57 }
michael@0 58 SimpleTest.waitForExplicitFinish();
michael@0 59 addA11yLoadEvent(doTest);
michael@0 60 </script>
michael@0 61 </head>
michael@0 62 <body >
michael@0 63
michael@0 64 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=410052">Mozilla Bug 410052</a>
michael@0 65 <a target="_blank"
michael@0 66 href="https://bugzilla.mozilla.org/show_bug.cgi?id=760878"
michael@0 67 title="decomtaminate Get Row / Column Description() on accessible tables">
michael@0 68 Mozilla Bug 760878
michael@0 69 </a>
michael@0 70
michael@0 71 <p id="display"></p>
michael@0 72 <div id="content" style="display: none"></div>
michael@0 73 <pre id="test">
michael@0 74 </pre>
michael@0 75
michael@0 76 <!-- Test Table -->
michael@0 77 <br><br><b> Testing Table:</b><br><br>
michael@0 78 <center>
michael@0 79 <table id="table" border="1"
michael@0 80 summary="this is a test table for nsIAccessibleTable" >
michael@0 81 <caption>Test Table</caption>
michael@0 82 <thead>
michael@0 83 <tr>
michael@0 84 <th></th>
michael@0 85 <th>columnHeader_1</th>
michael@0 86 <th id ="col2a">columnHeader_2</th>
michael@0 87 <th>columnHeader_3</th>
michael@0 88 </tr>
michael@0 89 </thead>
michael@0 90 <tr>
michael@0 91 <th id="row2a">rowHeader_1</th>
michael@0 92 <td id="row2b">row1_column1</td>
michael@0 93 <td id ="col2b">row1_column2</td>
michael@0 94 <td id="row2c">row1_column3</td>
michael@0 95 </tr>
michael@0 96 <tr>
michael@0 97 <th>rowHeader_2</th>
michael@0 98 <td>row2_column1</td>
michael@0 99 <td id ="col2c">row2_column2</td>
michael@0 100 <td>row2_column3</td>
michael@0 101 </tr>
michael@0 102 </table>
michael@0 103 </center>
michael@0 104 </body>
michael@0 105 </html>

mercurial