accessible/tests/mochitest/table/test_struct_table.html

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

michael@0 1 <!DOCTYPE html>
michael@0 2 <html>
michael@0 3
michael@0 4 <head>
michael@0 5 <title>Table accessible tree and table interface tests for HTML tables</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="../table.js"></script>
michael@0 18
michael@0 19 <script type="application/javascript">
michael@0 20 function doTest()
michael@0 21 {
michael@0 22 //////////////////////////////////////////////////////////////////////////
michael@0 23 // column headers from thead and tfoot
michael@0 24
michael@0 25 cellsArray = [
michael@0 26 [kColHeaderCell, kColHeaderCell, kColSpanned],
michael@0 27 [kRowSpanned, kColHeaderCell, kColHeaderCell],
michael@0 28 [kDataCell, kDataCell, kDataCell],
michael@0 29 [kColHeaderCell, kColHeaderCell, kColHeaderCell]
michael@0 30 ];
michael@0 31
michael@0 32 testTableStruct("table1", cellsArray);
michael@0 33
michael@0 34 //////////////////////////////////////////////////////////////////////////
michael@0 35 // row and column headers from thead and @scope
michael@0 36
michael@0 37 var cellsArray = [
michael@0 38 [kColHeaderCell, kColHeaderCell, kColHeaderCell],
michael@0 39 [kRowHeaderCell, kDataCell, kDataCell],
michael@0 40 [kRowHeaderCell, kDataCell, kDataCell]
michael@0 41 ];
michael@0 42
michael@0 43 testTableStruct("table2", cellsArray);
michael@0 44
michael@0 45 //////////////////////////////////////////////////////////////////////////
michael@0 46 // caption and @summary
michael@0 47
michael@0 48 cellsArray = [
michael@0 49 [kColHeaderCell, kColHeaderCell, kColHeaderCell, kColHeaderCell],
michael@0 50 [kRowHeaderCell, kDataCell, kDataCell, kDataCell],
michael@0 51 [kRowHeaderCell, kDataCell, kDataCell, kDataCell]
michael@0 52 ];
michael@0 53
michael@0 54 testTableStruct("table3", cellsArray, kNoColumnHeader,
michael@0 55 "Test Table",
michael@0 56 "this is a test table for nsIAccessibleTable");
michael@0 57
michael@0 58 //////////////////////////////////////////////////////////////////////////
michael@0 59 // row and column spans
michael@0 60
michael@0 61 cellsArray = [
michael@0 62 [kDataCell, kDataCell, kDataCell, kColSpanned, kDataCell, kDataCell, kDataCell, kDataCell],
michael@0 63 [kDataCell, kDataCell, kDataCell, kDataCell, kDataCell, kDataCell, kDataCell, kRowSpanned],
michael@0 64 [kDataCell, kDataCell, kColSpanned, kDataCell, kDataCell, kDataCell, kDataCell, kRowSpanned],
michael@0 65 [kDataCell, kRowSpanned, kSpanned, kDataCell, kDataCell, kRowSpanned, kDataCell, kRowSpanned]
michael@0 66 ];
michael@0 67
michael@0 68 testTableStruct("table4", cellsArray);
michael@0 69
michael@0 70 SimpleTest.finish();
michael@0 71 }
michael@0 72
michael@0 73 SimpleTest.waitForExplicitFinish();
michael@0 74 addA11yLoadEvent(doTest);
michael@0 75 </script>
michael@0 76 </head>
michael@0 77 <body>
michael@0 78
michael@0 79 <a target="_blank"
michael@0 80 title="Fix our nsHTMLAccessibleTable class so GetIndexAt and GetRowAtIndex and GetColumnAtIndex behave consistently"
michael@0 81 href="https://bugzilla.mozilla.org/show_bug.cgi?id=410052">Mozilla Bug 410052</a>
michael@0 82 <a target="_blank"
michael@0 83 title="GetCellDataAt callers that expect an error if no cell is found are wrong"
michael@0 84 href="https://bugzilla.mozilla.org/show_bug.cgi?id=417912">Mozilla Bug 417912</a>
michael@0 85 <a target="_blank"
michael@0 86 title="create accessibles for HTML tr"
michael@0 87 href="https://bugzilla.mozilla.org/show_bug.cgi?id=493695">Mozilla Bug 493695</a>
michael@0 88 <a target="_blank"
michael@0 89 title="implement IAccessibleTable2"
michael@0 90 href="https://bugzilla.mozilla.org/show_bug.cgi?id=512424">Mozilla Bug 512424</a>
michael@0 91
michael@0 92 <p id="display"></p>
michael@0 93 <div id="content" style="display: none"></div>
michael@0 94 <pre id="test">
michael@0 95 </pre>
michael@0 96
michael@0 97 <table id="table1">
michael@0 98 <thead>
michael@0 99 <tr>
michael@0 100 <th rowspan="2">col1</th><th colspan="2">col2</th>
michael@0 101 </tr>
michael@0 102 <tr>
michael@0 103 <th>col2sub1</th><th>col2sub2</th>
michael@0 104 </tr>
michael@0 105 </thead>
michael@0 106 <tbody>
michael@0 107 <tr>
michael@0 108 <td>cell1</td><td>cell2</td><td>cell3</td>
michael@0 109 </tr>
michael@0 110 </tbody>
michael@0 111 <tfoot>
michael@0 112 <tr>
michael@0 113 <th>col1</th><th>col2</th><th>col3</th>
michael@0 114 </tr>
michael@0 115 </tfoot>
michael@0 116 </table>
michael@0 117
michael@0 118 <table id="table2">
michael@0 119 <thead>
michael@0 120 <tr>
michael@0 121 <th id="table1_0">col1</th>
michael@0 122 <th id="table1_1">col2</th>
michael@0 123 <td id="table1_2" scope="col">col3</td>
michael@0 124 </tr>
michael@0 125 </thead>
michael@0 126 <tbody>
michael@0 127 <tr>
michael@0 128 <th id="table1_3">row1</th>
michael@0 129 <td id="table1_4">cell1</td>
michael@0 130 <td id="table1_5">cell2</td>
michael@0 131 </tr>
michael@0 132 <tr>
michael@0 133 <td id="table1_6" scope="row">row2</td>
michael@0 134 <td id="table1_7">cell3</td>
michael@0 135 <td id="table1_8">cell4</td>
michael@0 136 </tr>
michael@0 137 </tbody>
michael@0 138 </table>
michael@0 139
michael@0 140 <table id="table3" border="1"
michael@0 141 summary="this is a test table for nsIAccessibleTable">
michael@0 142 <caption>Test Table</caption>
michael@0 143 <thead>
michael@0 144 <tr>
michael@0 145 <th></th>
michael@0 146 <th>columnHeader_1</th>
michael@0 147 <th id ="col2a">columnHeader_2</th>
michael@0 148 <th>columnHeader_3</th>
michael@0 149 </tr>
michael@0 150 </thead>
michael@0 151 <tr>
michael@0 152 <th id="row2a">rowHeader_1</th>
michael@0 153 <td id="row2b">row1_column1</td>
michael@0 154 <td id ="col2b">row1_column2</td>
michael@0 155 <td id="row2c">row1_column3</td>
michael@0 156 </tr>
michael@0 157 <tr>
michael@0 158 <th>rowHeader_2</th>
michael@0 159 <td>row2_column1</td>
michael@0 160 <td id ="col2c">row2_column2</td>
michael@0 161 <td>row2_column3</td>
michael@0 162 </tr>
michael@0 163 </table>
michael@0 164
michael@0 165 <table id="table4" cellpadding="2" cellspacing="2" border="1" width="50%">
michael@0 166 <tbody>
michael@0 167 <tr>
michael@0 168 <td><br></td>
michael@0 169 <td><br></td>
michael@0 170 <td rowspan="1" colspan="2"><br></td>
michael@0 171 <td><br></td>
michael@0 172 <td><br></td>
michael@0 173 <td><br></td>
michael@0 174 <td rowspan="4" colspan="1"><br></td>
michael@0 175 </tr>
michael@0 176 <tr>
michael@0 177 <td><br></td>
michael@0 178 <td><br></td>
michael@0 179 <td><br></td>
michael@0 180 <td><br></td>
michael@0 181 <td><br></td>
michael@0 182 <td><br></td>
michael@0 183 <td><br></td>
michael@0 184 </tr>
michael@0 185 <tr>
michael@0 186 <td><br></td>
michael@0 187 <td rowspan="2" colspan="2">c1</td>
michael@0 188 <td><br></td>
michael@0 189 <td><br></td>
michael@0 190 <td rowspan="2" colspan="1"><br></td>
michael@0 191 <td><br></td>
michael@0 192 </tr>
michael@0 193 <tr>
michael@0 194 <td><br></td>
michael@0 195 <td><br></td>
michael@0 196 <td><br></td>
michael@0 197 <td><br></td>
michael@0 198 </tr>
michael@0 199 </tbody>
michael@0 200 </table>
michael@0 201
michael@0 202 </body>
michael@0 203 </html>

mercurial