accessible/tests/mochitest/table/test_struct_ariagrid.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>
     4 <head>
     5   <title>Table accessible tree and table interface tests for ARIA grid</title>
     6   <link rel="stylesheet" type="text/css"
     7         href="chrome://mochikit/content/tests/SimpleTest/test.css" />
     9   <script type="application/javascript"
    10           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
    12   <script type="application/javascript"
    13           src="../common.js"></script>
    14   <script type="application/javascript"
    15           src="../role.js"></script>
    16   <script type="application/javascript"
    17           src="../table.js"></script>
    19   <script type="application/javascript">
    20     function doTest()
    21     {
    22       //////////////////////////////////////////////////////////////////////////
    23       // Pure ARIA grid
    24       var cellsArray = [
    25         [kColHeaderCell, kColHeaderCell, kColHeaderCell],
    26         [kRowHeaderCell, kDataCell,      kDataCell],
    27         [kRowHeaderCell, kDataCell,      kDataCell]
    28       ];
    30       testTableStruct("table", cellsArray);
    32       //////////////////////////////////////////////////////////////////////////
    33       // HTML table based ARIA grid
    34       cellsArray = [
    35         [kColHeaderCell, kColHeaderCell, kColHeaderCell],
    36         [kDataCell,      kDataCell,      kDataCell],
    37         [kDataCell,      kDataCell,      kDataCell]
    38       ];
    40       testTableStruct("grid", cellsArray);
    42       //////////////////////////////////////////////////////////////////////////
    43       // ARIA grid with HTML table elements
    44       cellsArray = [
    45         [kColHeaderCell, kColHeaderCell],
    46         [kDataCell,      kDataCell]
    47       ];
    49       testTableStruct("grid2", cellsArray);
    51       //////////////////////////////////////////////////////////////////////////
    52       // ARIA grid of wrong markup
    53       cellsArray = [ ];
    54       testTableStruct("grid3", cellsArray);
    56       cellsArray = [ [] ];
    57       testTableStruct("grid4", cellsArray);
    59       SimpleTest.finish();
    60     }
    62     SimpleTest.waitForExplicitFinish();
    63     addA11yLoadEvent(doTest);
    64   </script>
    65 </head>
    67 <body>
    68   <a target="_blank"
    69      title="ARIA grid based on HTML table"
    70      href="https://bugzilla.mozilla.org/show_bug.cgi?id=491683">Mozilla Bug 491683</a>
    71   <a target="_blank"
    72      title="implement IAccessibleTable2"
    73      href="https://bugzilla.mozilla.org/show_bug.cgi?id=512424">Mozilla Bug 512424</a>
    74   <a target="_blank"
    75      title="nsHTMLTableCellAccessible is used in dojo's crazy ARIA grid"
    76      href="https://bugzilla.mozilla.org/show_bug.cgi?id=513848">Mozilla Bug 513848</a>
    77   <a target="_blank"
    78      title="Crash [@ AccIterator::GetNext()]"
    79      href="https://bugzilla.mozilla.org/show_bug.cgi?id=675861">Mozilla Bug 675861</a>
    81   <p id="display"></p>
    82   <div id="content" style="display: none"></div>
    83   <pre id="test">
    84   </pre>
    86   <!-- Not usual markup to avoid text accessible between cell accessibles -->
    87   <div id="table" role="grid">
    88     <div role="row"><span
    89       id="table_ch_1" role="columnheader">col_1</span><span
    90       id="table_ch_2" role="columnheader">col_2</span><span
    91       id="table_ch_3" role="columnheader">col_3</span></div>
    92     <div role="row"><span
    93       id="table_rh_1" role="rowheader">row_1</span><span
    94       id="table_dc_1" role="gridcell">cell1</span><span
    95       id="table_dc_2" role="gridcell">cell2</span></div>
    96     <div role="row"><span
    97       id="table_rh_2" role="rowheader">row_2</span><span
    98       id="table_dc_3" role="gridcell">cell3</span><span
    99       id="table_dc_4" role="gridcell">cell4</span></div>
   100   </div>
   102   <table role="grid" id="grid" border="1" cellpadding="10" cellspacing="0">
   103     <thead>
   104       <tr role="row">
   105         <th role="columnheader">subject</td>
   106         <th role="columnheader">sender</th>
   107         <th role="columnheader">date</th>
   108       </tr>
   109     </thead>
   110     <tbody>
   111       <tr role="row">
   112         <td role="gridcell" tabindex="0">about everything</td>
   113         <td role="gridcell">president</td>
   114         <td role="gridcell">today</td>
   115       </tr>
   116       <tr role="row">
   117         <td role="gridcell">new bugs</td>
   118         <td role="gridcell">mozilla team</td>
   119         <td role="gridcell">today</td>
   120       </tr>
   121     </tbody>
   122   </table>
   124   <!-- ARIA grid containing presentational HTML:table with HTML:td used as ARIA
   125     grid cells (focusable and not focusable cells) -->
   126   <div role="grid" id="grid2">
   127     <div role="row">
   128       <table role="presentation">
   129         <tr>
   130           <td role="columnheader">header1</td>
   131           <td role="columnheader">header2</td>
   132         </tr>
   133       </table>
   134     </div>
   135     <div role="row">
   136       <table role="presentation">
   137         <tr>
   138           <td role="gridcell">cell1</td>
   139           <td role="gridcell" tabindex="-1">cell2</td>
   140         </tr>
   141       </table>
   142     </div>
   143   </div>
   145   <!-- Wrong markup ARIA grid -->
   146   <div role="grid" id="grid3"></div>
   147   <div role="grid" id="grid4"><div role="row"></div></div>
   148 </body>
   149 </html>

mercurial