accessible/tests/mochitest/table/test_indexes_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.

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

mercurial