accessible/tests/mochitest/table/test_sels_table.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 <title>nsIAccesible selection methods testing for HTML table</title>
michael@0 6 <link rel="stylesheet" type="text/css"
michael@0 7 href="chrome://mochikit/content/tests/SimpleTest/test.css" />
michael@0 8
michael@0 9 <script type="application/javascript"
michael@0 10 src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
michael@0 11
michael@0 12 <script type="application/javascript"
michael@0 13 src="../common.js"></script>
michael@0 14 <script type="application/javascript"
michael@0 15 src="../role.js"></script>
michael@0 16 <script type="application/javascript"
michael@0 17 src="../states.js"></script>
michael@0 18 <script type="application/javascript"
michael@0 19 src="../table.js"></script>
michael@0 20
michael@0 21 <script type="text/javascript">
michael@0 22
michael@0 23 function doTest()
michael@0 24 {
michael@0 25 //////////////////////////////////////////////////////////////////////////
michael@0 26 // table
michael@0 27
michael@0 28 var cellsArray =
michael@0 29 [
michael@0 30 [false, false, false, kColSpanned, false, false, false, false],
michael@0 31 [false, false, false, false, false, false, false, kRowSpanned],
michael@0 32 [false, false, kColSpanned, false, false, false, false, kRowSpanned],
michael@0 33 [false, kRowSpanned, kSpanned, false, false, kRowSpanned, false, kRowSpanned]
michael@0 34 ];
michael@0 35
michael@0 36 testTableSelection("table", cellsArray);
michael@0 37
michael@0 38 var rowCount = 4;
michael@0 39 for (var rowIdx = 0; rowIdx < rowCount; rowIdx++)
michael@0 40 testSelectTableRow("table", rowIdx, cellsArray);
michael@0 41
michael@0 42 for (var rowIdx = 0; rowIdx < rowCount; rowIdx++) {
michael@0 43 testSelectTableRow("table", rowIdx, cellsArray);
michael@0 44 testUnselectTableRow("table", rowIdx, cellsArray);
michael@0 45 }
michael@0 46
michael@0 47 var columsCount = 8;
michael@0 48 for (var colIdx = 0; colIdx < columsCount; colIdx++)
michael@0 49 testSelectTableColumn("table", colIdx, cellsArray);
michael@0 50
michael@0 51 for (var colIdx = 0; colIdx < columsCount; colIdx++) {
michael@0 52 testSelectTableColumn("table", colIdx, cellsArray);
michael@0 53 testUnselectTableColumn("table", colIdx, cellsArray);
michael@0 54 }
michael@0 55
michael@0 56 var accTable = getAccessible("table", [nsIAccessibleTable]);
michael@0 57 ok(!accTable.isProbablyForLayout(), "table is not for layout");
michael@0 58
michael@0 59 //////////////////////////////////////////////////////////////////////////
michael@0 60 // table instane
michael@0 61
michael@0 62 cellsArray =
michael@0 63 [
michael@0 64 [false, false, false, -1, -1],
michael@0 65 [false, false, false, -1, -1],
michael@0 66 [false, false, kColSpanned, kColSpanned, -1],
michael@0 67 [kRowSpanned, false, false, -1, -1],
michael@0 68 [kRowSpanned, false, kRowSpanned, false, false]
michael@0 69 ];
michael@0 70
michael@0 71 testTableSelection("tableinsane", cellsArray);
michael@0 72
michael@0 73 SimpleTest.finish();
michael@0 74 }
michael@0 75
michael@0 76 SimpleTest.waitForExplicitFinish();
michael@0 77 addA11yLoadEvent(doTest);
michael@0 78 </script>
michael@0 79 </head>
michael@0 80 <body>
michael@0 81
michael@0 82 <a target="_blank"
michael@0 83 href="https://bugzilla.mozilla.org/show_bug.cgi?id=410052"
michael@0 84 title="Fix our nsHTMLAccessibleTable class so GetIndexAt and GetRowAtIndex and GetColumnAtIndex behave consistently">
michael@0 85 Mozilla Bug 410052
michael@0 86 </a>
michael@0 87 <a target="_blank"
michael@0 88 href="https://bugzilla.mozilla.org/show_bug.cgi?id=501635"
michael@0 89 title="nsHTMLTableAccessible::GetSelectedCells contains index duplicates for spanned rows or columns">
michael@0 90 Mozilla Bug 501635
michael@0 91 </a>
michael@0 92 <a target="_blank"
michael@0 93 href="https://bugzilla.mozilla.org/show_bug.cgi?id=417929"
michael@0 94 title="nsIAccessiblTable selectRows does not unselect previously selected rows">
michael@0 95 Mozilla Bug 417929
michael@0 96 </a>
michael@0 97 <a target="_blank"
michael@0 98 href="https://bugzilla.mozilla.org/show_bug.cgi?id=501659"
michael@0 99 title="HTML table's isRowSelected/isColumnSelected shouldn't fail if row or column has cell holes">
michael@0 100 Mozilla Bug 501659
michael@0 101 </a>
michael@0 102
michael@0 103 <p id="display"></p>
michael@0 104 <div id="content" style="display: none"></div>
michael@0 105 <pre id="test">
michael@0 106 </pre>
michael@0 107
michael@0 108 <!-- Test Table -->
michael@0 109 <br><br><b> Testing Table:</b><br><br>
michael@0 110 <center>
michael@0 111 <table cellpadding="2" cellspacing="2" border="1" width="50%" id="table">
michael@0 112 <tbody>
michael@0 113 <tr>
michael@0 114 <td><br></td>
michael@0 115 <td><br></td>
michael@0 116 <td rowspan="1" colspan="2"><br></td>
michael@0 117 <td><br></td>
michael@0 118 <td><br></td>
michael@0 119 <td><br></td>
michael@0 120 <td rowspan="4" colspan="1"><br></td>
michael@0 121 </tr>
michael@0 122 <tr>
michael@0 123 <td><br></td>
michael@0 124 <td><br></td>
michael@0 125 <td><br></td>
michael@0 126 <td><br></td>
michael@0 127 <td><br></td>
michael@0 128 <td><br></td>
michael@0 129 <td><br></td>
michael@0 130 </tr>
michael@0 131 <tr>
michael@0 132 <td><br></td>
michael@0 133 <td rowspan="2" colspan="2">c1</td>
michael@0 134 <td><br></td>
michael@0 135 <td><br></td>
michael@0 136 <td rowspan="2" colspan="1"><br></td>
michael@0 137 <td><br></td>
michael@0 138 </tr>
michael@0 139 <tr>
michael@0 140 <td><br></td>
michael@0 141 <td><br></td>
michael@0 142 <td><br></td>
michael@0 143 <td><br></td>
michael@0 144 </tr>
michael@0 145 </tbody>
michael@0 146 </table>
michael@0 147
michael@0 148 <table border="1" id="tableinsane">
michael@0 149 <thead>
michael@0 150 <tr>
michael@0 151 <th>col1</th>
michael@0 152 <th>col2</th>
michael@0 153 <th>col3</th>
michael@0 154 </tr>
michael@0 155 </thead>
michael@0 156 <tbody>
michael@0 157 <tr>
michael@0 158 <td>1</td>
michael@0 159 <td>2</td>
michael@0 160 <td>3</td>
michael@0 161 </tr>
michael@0 162 <tr>
michael@0 163 <td rowspan="3">4</td>
michael@0 164 <td colspan="4">5</td>
michael@0 165 </tr>
michael@0 166 <tr>
michael@0 167 <td>6</td>
michael@0 168 <td rowspan="2">7</td>
michael@0 169 </tr>
michael@0 170 <tr>
michael@0 171 <td>8</td>
michael@0 172 <td>9</td>
michael@0 173 <td>10</td>
michael@0 174 </tr>
michael@0 175 </tbody>
michael@0 176 </table>
michael@0 177
michael@0 178 </center>
michael@0 179 </body>
michael@0 180 </html>

mercurial