accessible/tests/mochitest/table/test_sels_table.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/accessible/tests/mochitest/table/test_sels_table.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,180 @@
     1.4 +<!DOCTYPE HTML PUBLIC "-//w3c//dtd html 4.0 transitional//en">
     1.5 +<html>
     1.6 + <head>
     1.7 +  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
     1.8 +  <title>nsIAccesible selection methods testing for HTML table</title>
     1.9 +  <link rel="stylesheet" type="text/css"
    1.10 +        href="chrome://mochikit/content/tests/SimpleTest/test.css" />
    1.11 +
    1.12 +  <script type="application/javascript"
    1.13 +          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
    1.14 +
    1.15 +  <script type="application/javascript"
    1.16 +          src="../common.js"></script>
    1.17 +  <script type="application/javascript"
    1.18 +          src="../role.js"></script>
    1.19 +  <script type="application/javascript"
    1.20 +          src="../states.js"></script>
    1.21 +  <script type="application/javascript"
    1.22 +          src="../table.js"></script>
    1.23 +
    1.24 +  <script type="text/javascript">
    1.25 +
    1.26 +    function doTest()
    1.27 +    {
    1.28 +      //////////////////////////////////////////////////////////////////////////
    1.29 +      // table
    1.30 +
    1.31 +      var cellsArray =
    1.32 +      [
    1.33 +        [false, false,       false,       kColSpanned, false, false,       false, false],
    1.34 +        [false, false,       false,       false,       false, false,       false, kRowSpanned],
    1.35 +        [false, false,       kColSpanned, false,       false, false,       false, kRowSpanned],
    1.36 +        [false, kRowSpanned, kSpanned,    false,       false, kRowSpanned, false, kRowSpanned]
    1.37 +      ];
    1.38 +
    1.39 +      testTableSelection("table", cellsArray);
    1.40 +
    1.41 +      var rowCount = 4;
    1.42 +      for (var rowIdx = 0; rowIdx < rowCount; rowIdx++)
    1.43 +        testSelectTableRow("table", rowIdx, cellsArray);
    1.44 +
    1.45 +      for (var rowIdx = 0; rowIdx < rowCount; rowIdx++) {
    1.46 +        testSelectTableRow("table", rowIdx, cellsArray);
    1.47 +        testUnselectTableRow("table", rowIdx, cellsArray);
    1.48 +      }
    1.49 +
    1.50 +      var columsCount = 8;
    1.51 +      for (var colIdx = 0; colIdx < columsCount; colIdx++)
    1.52 +        testSelectTableColumn("table", colIdx, cellsArray);
    1.53 +
    1.54 +      for (var colIdx = 0; colIdx < columsCount; colIdx++) {
    1.55 +        testSelectTableColumn("table", colIdx, cellsArray);
    1.56 +        testUnselectTableColumn("table", colIdx, cellsArray);
    1.57 +      }
    1.58 +
    1.59 +      var accTable = getAccessible("table", [nsIAccessibleTable]);
    1.60 +      ok(!accTable.isProbablyForLayout(), "table is not for layout");
    1.61 +
    1.62 +      //////////////////////////////////////////////////////////////////////////
    1.63 +      // table instane
    1.64 +
    1.65 +      cellsArray =
    1.66 +      [
    1.67 +        [false,       false, false,       -1,          -1],
    1.68 +        [false,       false, false,       -1,          -1],
    1.69 +        [false,       false, kColSpanned, kColSpanned, -1],
    1.70 +        [kRowSpanned, false, false,       -1,          -1],
    1.71 +        [kRowSpanned, false, kRowSpanned, false,       false]
    1.72 +      ];
    1.73 +
    1.74 +      testTableSelection("tableinsane", cellsArray);
    1.75 +
    1.76 +      SimpleTest.finish();
    1.77 +    }
    1.78 +
    1.79 +    SimpleTest.waitForExplicitFinish();
    1.80 +    addA11yLoadEvent(doTest);
    1.81 +  </script>
    1.82 + </head>
    1.83 + <body>
    1.84 +
    1.85 +  <a target="_blank"
    1.86 +     href="https://bugzilla.mozilla.org/show_bug.cgi?id=410052"
    1.87 +     title="Fix our nsHTMLAccessibleTable class so GetIndexAt and GetRowAtIndex and GetColumnAtIndex behave consistently">
    1.88 +    Mozilla Bug 410052
    1.89 +  </a>
    1.90 +  <a target="_blank"
    1.91 +     href="https://bugzilla.mozilla.org/show_bug.cgi?id=501635"
    1.92 +     title="nsHTMLTableAccessible::GetSelectedCells contains index duplicates for spanned rows or columns">
    1.93 +    Mozilla Bug 501635
    1.94 +  </a>
    1.95 +  <a target="_blank"
    1.96 +     href="https://bugzilla.mozilla.org/show_bug.cgi?id=417929"
    1.97 +     title="nsIAccessiblTable selectRows does not unselect previously selected rows">
    1.98 +    Mozilla Bug 417929
    1.99 +  </a>
   1.100 +  <a target="_blank"
   1.101 +     href="https://bugzilla.mozilla.org/show_bug.cgi?id=501659"
   1.102 +     title="HTML table's isRowSelected/isColumnSelected shouldn't fail if row or column has cell holes">
   1.103 +    Mozilla Bug 501659
   1.104 +  </a>
   1.105 +
   1.106 +  <p id="display"></p>
   1.107 +  <div id="content" style="display: none"></div>
   1.108 +  <pre id="test">
   1.109 +  </pre>
   1.110 +
   1.111 +  <!-- Test Table -->
   1.112 +  <br><br><b> Testing Table:</b><br><br>
   1.113 +  <center>
   1.114 +   <table cellpadding="2" cellspacing="2" border="1" width="50%" id="table">
   1.115 +    <tbody>
   1.116 +     <tr>
   1.117 +      <td><br></td>
   1.118 +      <td><br></td>
   1.119 +      <td rowspan="1" colspan="2"><br></td>
   1.120 +      <td><br></td>
   1.121 +      <td><br></td>
   1.122 +      <td><br></td>
   1.123 +      <td rowspan="4" colspan="1"><br></td>
   1.124 +     </tr>
   1.125 +     <tr>
   1.126 +      <td><br></td>
   1.127 +      <td><br></td>
   1.128 +      <td><br></td>
   1.129 +      <td><br></td>
   1.130 +      <td><br></td>
   1.131 +      <td><br></td>
   1.132 +      <td><br></td>
   1.133 +     </tr>
   1.134 +     <tr>
   1.135 +      <td><br></td>
   1.136 +      <td rowspan="2" colspan="2">c1</td>
   1.137 +      <td><br></td>
   1.138 +      <td><br></td>
   1.139 +      <td rowspan="2" colspan="1"><br></td>
   1.140 +      <td><br></td>
   1.141 +     </tr>
   1.142 +     <tr>
   1.143 +      <td><br></td>
   1.144 +      <td><br></td>
   1.145 +      <td><br></td>
   1.146 +      <td><br></td>
   1.147 +     </tr>
   1.148 +    </tbody>
   1.149 +   </table>
   1.150 +
   1.151 +   <table border="1" id="tableinsane">
   1.152 +    <thead>
   1.153 +     <tr>
   1.154 +      <th>col1</th>
   1.155 +      <th>col2</th>
   1.156 +      <th>col3</th>
   1.157 +     </tr>
   1.158 +    </thead>
   1.159 +     <tbody>
   1.160 +      <tr>
   1.161 +       <td>1</td>
   1.162 +       <td>2</td>
   1.163 +       <td>3</td>
   1.164 +      </tr>
   1.165 +      <tr>
   1.166 +       <td rowspan="3">4</td>
   1.167 +       <td colspan="4">5</td>
   1.168 +      </tr>
   1.169 +      <tr>
   1.170 +       <td>6</td>
   1.171 +       <td rowspan="2">7</td>
   1.172 +      </tr>
   1.173 +      <tr>
   1.174 +       <td>8</td>
   1.175 +       <td>9</td>
   1.176 +       <td>10</td>
   1.177 +      </tr>
   1.178 +     </tbody>
   1.179 +    </table>
   1.180 +
   1.181 +  </center>
   1.182 + </body>
   1.183 +</html>

mercurial