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.

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

mercurial