Tue, 06 Jan 2015 21:39:09 +0100
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 | https://bugzilla.mozilla.org/show_bug.cgi?id=410052 |
michael@0 | 5 | --> |
michael@0 | 6 | <head> |
michael@0 | 7 | <title>Table indexes chrome tests</title> |
michael@0 | 8 | <link rel="stylesheet" type="text/css" |
michael@0 | 9 | href="chrome://mochikit/content/tests/SimpleTest/test.css" /> |
michael@0 | 10 | |
michael@0 | 11 | <script type="application/javascript" |
michael@0 | 12 | src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> |
michael@0 | 13 | |
michael@0 | 14 | <script type="application/javascript" |
michael@0 | 15 | src="../common.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 | // table |
michael@0 | 24 | var idxes = [ |
michael@0 | 25 | [0, 1, 2], |
michael@0 | 26 | [3, 4, 5], |
michael@0 | 27 | [6, 7, 7], |
michael@0 | 28 | [6, 8, 9] |
michael@0 | 29 | ]; |
michael@0 | 30 | |
michael@0 | 31 | testTableIndexes("table", idxes); |
michael@0 | 32 | |
michael@0 | 33 | ////////////////////////////////////////////////////////////////////////// |
michael@0 | 34 | // tableborder |
michael@0 | 35 | idxes = [ |
michael@0 | 36 | [0, 1, 2], |
michael@0 | 37 | [3, 4, 5], |
michael@0 | 38 | [6, 7, 7], |
michael@0 | 39 | [6, 8, 9] |
michael@0 | 40 | ]; |
michael@0 | 41 | |
michael@0 | 42 | testTableIndexes("tableborder", idxes); |
michael@0 | 43 | |
michael@0 | 44 | ////////////////////////////////////////////////////////////////////////// |
michael@0 | 45 | // table |
michael@0 | 46 | var idxes = [ |
michael@0 | 47 | [ 0, 1, 2, 2, 3, 4, 5, 6], |
michael@0 | 48 | [ 7, 8, 9, 10, 11, 12, 13, 6], |
michael@0 | 49 | [14, 15, 15, 16, 17, 18, 19, 6], |
michael@0 | 50 | [20, 15, 15, 21, 22, 18, 23, 6] |
michael@0 | 51 | ]; |
michael@0 | 52 | |
michael@0 | 53 | testTableIndexes("table2", idxes); |
michael@0 | 54 | |
michael@0 | 55 | ////////////////////////////////////////////////////////////////////////// |
michael@0 | 56 | // tableinsane1 (empty row groups) |
michael@0 | 57 | idxes = [ |
michael@0 | 58 | [0, 1, 2], |
michael@0 | 59 | [3, 4, 5], |
michael@0 | 60 | [6, 7, 7], |
michael@0 | 61 | [6, 8, 9] |
michael@0 | 62 | ]; |
michael@0 | 63 | |
michael@0 | 64 | testTableIndexes("tableinsane1", idxes); |
michael@0 | 65 | |
michael@0 | 66 | ////////////////////////////////////////////////////////////////////////// |
michael@0 | 67 | // tableinsane2 (empry rows) |
michael@0 | 68 | idxes = [ |
michael@0 | 69 | [-1, -1, -1], |
michael@0 | 70 | [-1, -1, -1], |
michael@0 | 71 | [ 0, 1, 2] |
michael@0 | 72 | ]; |
michael@0 | 73 | |
michael@0 | 74 | testTableIndexes("tableinsane2", idxes); |
michael@0 | 75 | |
michael@0 | 76 | ////////////////////////////////////////////////////////////////////////// |
michael@0 | 77 | // tableinsane3 (cell holes) |
michael@0 | 78 | idxes = [ |
michael@0 | 79 | [0, 1, -1], |
michael@0 | 80 | [2, 3, 4] |
michael@0 | 81 | ]; |
michael@0 | 82 | |
michael@0 | 83 | testTableIndexes("tableinsane3", idxes); |
michael@0 | 84 | |
michael@0 | 85 | ////////////////////////////////////////////////////////////////////////// |
michael@0 | 86 | // tableinsane3.2 (cell holes, row spans, fixed in bug 417912) |
michael@0 | 87 | idxes = [ |
michael@0 | 88 | [0, 1, 2], |
michael@0 | 89 | [3, -1, 2], |
michael@0 | 90 | [4, 5, 2] |
michael@0 | 91 | ]; |
michael@0 | 92 | |
michael@0 | 93 | testTableIndexes("tableinsane3.2", idxes); |
michael@0 | 94 | |
michael@0 | 95 | ////////////////////////////////////////////////////////////////////////// |
michael@0 | 96 | // tableinsane4 (empty row groups/rows and cell holes) |
michael@0 | 97 | idxes = [ |
michael@0 | 98 | [ 0, 1, 2], |
michael@0 | 99 | [-1, -1, -1], |
michael@0 | 100 | [ 3, 4, 5], |
michael@0 | 101 | [ 6, 6, 7], |
michael@0 | 102 | [ 8, -1, 7], |
michael@0 | 103 | [ 9, 9, 9] |
michael@0 | 104 | ]; |
michael@0 | 105 | testTableIndexes("tableinsane4", idxes); |
michael@0 | 106 | |
michael@0 | 107 | ////////////////////////////////////////////////////////////////////////// |
michael@0 | 108 | // tableinsane5 (just a crazy table) |
michael@0 | 109 | idxes = [ |
michael@0 | 110 | [ 0, 1, 2, -1, -1], |
michael@0 | 111 | [-1, -1, -1, -1, -1], |
michael@0 | 112 | [ 3, 4, 5, -1, -1], |
michael@0 | 113 | [ 6, 7, 7, 7, 7], |
michael@0 | 114 | [ 6, 8, 9, -1, -1], |
michael@0 | 115 | [ 6, 10, 9, 11, 12] |
michael@0 | 116 | ]; |
michael@0 | 117 | testTableIndexes("tableinsane5", idxes); |
michael@0 | 118 | |
michael@0 | 119 | ////////////////////////////////////////////////////////////////////////// |
michael@0 | 120 | // tableinsane6 (overlapping cells, mad table) |
michael@0 | 121 | idxes = [ |
michael@0 | 122 | [ 0, 1, 2, -1, -1], |
michael@0 | 123 | [-1, -1, -1, -1, -1], |
michael@0 | 124 | [ 3, 4, 5, -1, -1], |
michael@0 | 125 | [ 6, 6, 7, -1, -1], |
michael@0 | 126 | [ 8, 9, 7, -1, -1], |
michael@0 | 127 | [ 10, 9, 7, 11, 12] |
michael@0 | 128 | ]; |
michael@0 | 129 | testTableIndexes("tableinsane6", idxes); |
michael@0 | 130 | |
michael@0 | 131 | ////////////////////////////////////////////////////////////////////////// |
michael@0 | 132 | // csstablecrazy1 (no rows) |
michael@0 | 133 | idxes = [ |
michael@0 | 134 | [0, 1] |
michael@0 | 135 | ]; |
michael@0 | 136 | |
michael@0 | 137 | testTableIndexes("csstablecrazy1", idxes); |
michael@0 | 138 | |
michael@0 | 139 | SimpleTest.finish(); |
michael@0 | 140 | } |
michael@0 | 141 | |
michael@0 | 142 | SimpleTest.waitForExplicitFinish(); |
michael@0 | 143 | addA11yLoadEvent(doTest); |
michael@0 | 144 | </script> |
michael@0 | 145 | </head> |
michael@0 | 146 | <body> |
michael@0 | 147 | |
michael@0 | 148 | <a target="_blank" |
michael@0 | 149 | title="GetIndexAt and GetRowAtIndex and GetColumnAtIndex on HTML tables are inconsistent" |
michael@0 | 150 | href="https://bugzilla.mozilla.org/show_bug.cgi?id=410052"> |
michael@0 | 151 | Bug 410052 |
michael@0 | 152 | </a> |
michael@0 | 153 | <a target="_blank" |
michael@0 | 154 | title="Table cell accessibles not exposed for CSS table without table-row " |
michael@0 | 155 | href="https://bugzilla.mozilla.org/show_bug.cgi?id=834120"> |
michael@0 | 156 | Bug 834120 |
michael@0 | 157 | </a> |
michael@0 | 158 | <p id="display"></p> |
michael@0 | 159 | <div id="content" style="display: none"></div> |
michael@0 | 160 | <pre id="test"> |
michael@0 | 161 | </pre> |
michael@0 | 162 | |
michael@0 | 163 | <!-- |
michael@0 | 164 | If you change the structure of the table please make sure to change |
michael@0 | 165 | the indexes count in 'for' statement in the script above. |
michael@0 | 166 | --> |
michael@0 | 167 | <table border="1" id="table"> |
michael@0 | 168 | <caption><strong><b><font size="29">this is a caption for this table</font></b></strong></caption> |
michael@0 | 169 | <thead> |
michael@0 | 170 | <tr> |
michael@0 | 171 | <th>col1</th> |
michael@0 | 172 | <th>col2</th> |
michael@0 | 173 | <th>col3</th> |
michael@0 | 174 | </tr> |
michael@0 | 175 | </thead> |
michael@0 | 176 | <tbody> |
michael@0 | 177 | <tr> |
michael@0 | 178 | <td>1</td> |
michael@0 | 179 | <td>2</td> |
michael@0 | 180 | <td>3</td> |
michael@0 | 181 | </tr> |
michael@0 | 182 | <tr> |
michael@0 | 183 | <td rowspan="0">4</td> |
michael@0 | 184 | <td colspan="2">5</td> |
michael@0 | 185 | </tr> |
michael@0 | 186 | <tr> |
michael@0 | 187 | <td>6</td> |
michael@0 | 188 | <td>7</td> |
michael@0 | 189 | </tr> |
michael@0 | 190 | </tbody> |
michael@0 | 191 | </table> |
michael@0 | 192 | |
michael@0 | 193 | <table border="1" id="tableborder" style="border-collapse:collapse"> |
michael@0 | 194 | <caption><strong><b><font size="29">this is a caption for this bc table</font></b></strong></caption> |
michael@0 | 195 | <thead> |
michael@0 | 196 | <tr> |
michael@0 | 197 | <th>col1</th> |
michael@0 | 198 | <th>col2</th> |
michael@0 | 199 | <th>col3</th> |
michael@0 | 200 | </tr> |
michael@0 | 201 | </thead> |
michael@0 | 202 | <tbody> |
michael@0 | 203 | <tr> |
michael@0 | 204 | <td>1</td> |
michael@0 | 205 | <td>2</td> |
michael@0 | 206 | <td>3</td> |
michael@0 | 207 | </tr> |
michael@0 | 208 | <tr> |
michael@0 | 209 | <td rowspan="2">4</td> |
michael@0 | 210 | <td colspan="2">5</td> |
michael@0 | 211 | </tr> |
michael@0 | 212 | <tr> |
michael@0 | 213 | <td>6</td> |
michael@0 | 214 | <td>7</td> |
michael@0 | 215 | </tr> |
michael@0 | 216 | </tbody> |
michael@0 | 217 | </table> |
michael@0 | 218 | |
michael@0 | 219 | <table cellpadding="2" cellspacing="2" border="1" width="50%" id="table2"> |
michael@0 | 220 | <caption>column and row spans</caption> |
michael@0 | 221 | <tbody> |
michael@0 | 222 | <tr> |
michael@0 | 223 | <td>0</td> |
michael@0 | 224 | <td>1</td> |
michael@0 | 225 | <td rowspan="1" colspan="2">2</td> |
michael@0 | 226 | <td>3</td> |
michael@0 | 227 | <td>4</td> |
michael@0 | 228 | <td>5</td> |
michael@0 | 229 | <td rowspan="4" colspan="1">6</td> |
michael@0 | 230 | </tr> |
michael@0 | 231 | <tr> |
michael@0 | 232 | <td>7</td> |
michael@0 | 233 | <td>8</td> |
michael@0 | 234 | <td>8</td> |
michael@0 | 235 | <td>10</td> |
michael@0 | 236 | <td>11</td> |
michael@0 | 237 | <td>12</td> |
michael@0 | 238 | <td>13</td> |
michael@0 | 239 | </tr> |
michael@0 | 240 | <tr> |
michael@0 | 241 | <td>14</td> |
michael@0 | 242 | <td rowspan="2" colspan="2">15</td> |
michael@0 | 243 | <td>16</td> |
michael@0 | 244 | <td>17</td> |
michael@0 | 245 | <td rowspan="2" colspan="1">18</td> |
michael@0 | 246 | <td>19</td> |
michael@0 | 247 | </tr> |
michael@0 | 248 | <tr> |
michael@0 | 249 | <td>20</td> |
michael@0 | 250 | <td>21</td> |
michael@0 | 251 | <td>22</td> |
michael@0 | 252 | <td>23</td> |
michael@0 | 253 | </tr> |
michael@0 | 254 | </tbody> |
michael@0 | 255 | </table> |
michael@0 | 256 | |
michael@0 | 257 | <table border="1" id="tableinsane1"> |
michael@0 | 258 | <caption>test empty row groups</caption> |
michael@0 | 259 | <thead> |
michael@0 | 260 | <tr> |
michael@0 | 261 | <th>col1</th> |
michael@0 | 262 | <th>col2</th> |
michael@0 | 263 | <th>col3</th> |
michael@0 | 264 | </tr> |
michael@0 | 265 | </thead> |
michael@0 | 266 | <tbody></tbody> |
michael@0 | 267 | <tbody></tbody> |
michael@0 | 268 | <tbody></tbody> |
michael@0 | 269 | <tbody> |
michael@0 | 270 | <tr> |
michael@0 | 271 | <td>1</td> |
michael@0 | 272 | <td>2</td> |
michael@0 | 273 | <td>3</td> |
michael@0 | 274 | </tr> |
michael@0 | 275 | <tr> |
michael@0 | 276 | <td rowspan="2">4</td> |
michael@0 | 277 | <td colspan="2">5</td> |
michael@0 | 278 | </tr> |
michael@0 | 279 | <tr> |
michael@0 | 280 | <td>6</td> |
michael@0 | 281 | <td>7</td> |
michael@0 | 282 | </tr> |
michael@0 | 283 | </tbody> |
michael@0 | 284 | </table> |
michael@0 | 285 | |
michael@0 | 286 | <table border="1" id="tableinsane2"> |
michael@0 | 287 | <caption>empty rows</caption> |
michael@0 | 288 | <tbody><tr></tr><tr></tr></tbody> |
michael@0 | 289 | <tbody></tbody> |
michael@0 | 290 | <tbody> |
michael@0 | 291 | <tr> |
michael@0 | 292 | <td>0</td> |
michael@0 | 293 | <td>1</td> |
michael@0 | 294 | <td>2</td> |
michael@0 | 295 | </tr> |
michael@0 | 296 | </tbody> |
michael@0 | 297 | </table> |
michael@0 | 298 | |
michael@0 | 299 | <table border="1" id="tableinsane3"> |
michael@0 | 300 | <caption>missed cell</caption> |
michael@0 | 301 | <tbody> |
michael@0 | 302 | <tr> |
michael@0 | 303 | <td>0</td> |
michael@0 | 304 | <td>1</td> |
michael@0 | 305 | </tr> |
michael@0 | 306 | </tbody> |
michael@0 | 307 | <tbody> |
michael@0 | 308 | <tr> |
michael@0 | 309 | <td>2</td> |
michael@0 | 310 | <td>3</td> |
michael@0 | 311 | <td>4</td> |
michael@0 | 312 | </tr> |
michael@0 | 313 | </tbody> |
michael@0 | 314 | </table> |
michael@0 | 315 | |
michael@0 | 316 | <table cellpadding="2" cellspacing="2" border="1" id="tableinsane3.2"> |
michael@0 | 317 | <tr><td>1</td><td>2</td><td rowspan=3>3</td> |
michael@0 | 318 | <tr><td>4</td> |
michael@0 | 319 | <tr><td>5</td><td>6</td> |
michael@0 | 320 | </table> |
michael@0 | 321 | |
michael@0 | 322 | <table border="1" id="tableinsane4"> |
michael@0 | 323 | <caption>test empty rows + cellmap holes</caption> |
michael@0 | 324 | <thead> |
michael@0 | 325 | <tr> |
michael@0 | 326 | <th>col1</th> |
michael@0 | 327 | <th>col2</th> |
michael@0 | 328 | <th>col3</th> |
michael@0 | 329 | </tr> |
michael@0 | 330 | </thead> |
michael@0 | 331 | <tbody><tr></tr></tbody> |
michael@0 | 332 | <tbody></tbody> |
michael@0 | 333 | <tbody></tbody> |
michael@0 | 334 | <tbody> |
michael@0 | 335 | <tr> |
michael@0 | 336 | <td>1</td> |
michael@0 | 337 | <td>2</td> |
michael@0 | 338 | <td>3</td> |
michael@0 | 339 | </tr> |
michael@0 | 340 | <tr> |
michael@0 | 341 | <td colspan="2">4</td> |
michael@0 | 342 | <td rowspan="2">5</td> |
michael@0 | 343 | </tr> |
michael@0 | 344 | <tr> |
michael@0 | 345 | <td>6</td> |
michael@0 | 346 | </tr> |
michael@0 | 347 | <tr> |
michael@0 | 348 | <td colspan="3">7</td> |
michael@0 | 349 | </tr> |
michael@0 | 350 | |
michael@0 | 351 | </tbody> |
michael@0 | 352 | </table> |
michael@0 | 353 | |
michael@0 | 354 | <table border="1" id="tableinsane5"> |
michael@0 | 355 | <caption>just a crazy table</caption> |
michael@0 | 356 | <thead> |
michael@0 | 357 | <tr> |
michael@0 | 358 | <th>col1</th> |
michael@0 | 359 | <th>col2</th> |
michael@0 | 360 | <th>col3</th> |
michael@0 | 361 | </tr> |
michael@0 | 362 | </thead> |
michael@0 | 363 | <tbody><tr></tr></tbody> |
michael@0 | 364 | <tbody></tbody> |
michael@0 | 365 | <tbody></tbody> |
michael@0 | 366 | <tbody> |
michael@0 | 367 | <tr> |
michael@0 | 368 | <td>1</td> |
michael@0 | 369 | <td>2</td> |
michael@0 | 370 | <td>3</td> |
michael@0 | 371 | </tr> |
michael@0 | 372 | <tr> |
michael@0 | 373 | <td rowspan="0">4</td> |
michael@0 | 374 | <td colspan="0">5</td> |
michael@0 | 375 | </tr> |
michael@0 | 376 | <tr> |
michael@0 | 377 | <td>6</td> |
michael@0 | 378 | <td rowspan="0">7</td> |
michael@0 | 379 | </tr> |
michael@0 | 380 | <tr> |
michael@0 | 381 | <td>8</td> |
michael@0 | 382 | <td>9</td> |
michael@0 | 383 | <td>10</td> |
michael@0 | 384 | </tr> |
michael@0 | 385 | |
michael@0 | 386 | </tbody> |
michael@0 | 387 | |
michael@0 | 388 | <table border="1" id="tableinsane6" > |
michael@0 | 389 | <caption>overlapping cells</caption> |
michael@0 | 390 | <thead> |
michael@0 | 391 | <tr> |
michael@0 | 392 | <th>header cell 0</th> |
michael@0 | 393 | <th>header cell 1</th> |
michael@0 | 394 | <th>header cell 2</th> |
michael@0 | 395 | </tr> |
michael@0 | 396 | </thead> |
michael@0 | 397 | <tbody><tr></tr></tbody> |
michael@0 | 398 | <tbody></tbody> |
michael@0 | 399 | <tbody></tbody> |
michael@0 | 400 | <tbody> |
michael@0 | 401 | <tr> |
michael@0 | 402 | <td>3</td> |
michael@0 | 403 | <td>4</td> |
michael@0 | 404 | <td>5</td> |
michael@0 | 405 | </tr> |
michael@0 | 406 | <tr> |
michael@0 | 407 | <td colspan="2">6</td> |
michael@0 | 408 | <td rowspan="0">7</td> |
michael@0 | 409 | </tr> |
michael@0 | 410 | <tr> |
michael@0 | 411 | <td>8</td> |
michael@0 | 412 | <td rowspan="0">9</td> |
michael@0 | 413 | </tr> |
michael@0 | 414 | <tr> |
michael@0 | 415 | <td colspan="3">10</td> |
michael@0 | 416 | <td>11</td> |
michael@0 | 417 | <td>12</td> |
michael@0 | 418 | </tr> |
michael@0 | 419 | </tbody> |
michael@0 | 420 | </table> |
michael@0 | 421 | |
michael@0 | 422 | <div id="csstablecrazy1" |
michael@0 | 423 | style="width: 100%; border: 1px solid red; display:table;"> |
michael@0 | 424 | <div style="display:table-cell;">cell1</div> |
michael@0 | 425 | <div style="display:table-cell;">cell2</div> |
michael@0 | 426 | </div> |
michael@0 | 427 | |
michael@0 | 428 | </body> |
michael@0 | 429 | </html> |