accessible/tests/mochitest/table/test_struct_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_struct_table.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,203 @@
     1.4 +<!DOCTYPE html>
     1.5 +<html>
     1.6 +
     1.7 +<head>
     1.8 +  <title>Table accessible tree and table interface tests for HTML tables</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="../table.js"></script>
    1.21 +
    1.22 +  <script type="application/javascript">
    1.23 +    function doTest()
    1.24 +    {
    1.25 +      //////////////////////////////////////////////////////////////////////////
    1.26 +      // column headers from thead and tfoot
    1.27 +
    1.28 +      cellsArray = [
    1.29 +        [kColHeaderCell, kColHeaderCell, kColSpanned],
    1.30 +        [kRowSpanned,    kColHeaderCell, kColHeaderCell],
    1.31 +        [kDataCell,      kDataCell,      kDataCell],
    1.32 +        [kColHeaderCell, kColHeaderCell, kColHeaderCell]
    1.33 +      ];
    1.34 +
    1.35 +      testTableStruct("table1", cellsArray);
    1.36 +
    1.37 +      //////////////////////////////////////////////////////////////////////////
    1.38 +      // row and column headers from thead and @scope
    1.39 +
    1.40 +      var cellsArray = [
    1.41 +        [kColHeaderCell, kColHeaderCell, kColHeaderCell],
    1.42 +        [kRowHeaderCell, kDataCell, kDataCell],
    1.43 +        [kRowHeaderCell, kDataCell, kDataCell]
    1.44 +      ];
    1.45 +
    1.46 +      testTableStruct("table2", cellsArray);
    1.47 +
    1.48 +      //////////////////////////////////////////////////////////////////////////
    1.49 +      // caption and @summary
    1.50 +
    1.51 +      cellsArray = [
    1.52 +        [kColHeaderCell, kColHeaderCell, kColHeaderCell, kColHeaderCell],
    1.53 +        [kRowHeaderCell, kDataCell,      kDataCell,      kDataCell],
    1.54 +        [kRowHeaderCell, kDataCell,      kDataCell,      kDataCell]
    1.55 +      ];
    1.56 +
    1.57 +      testTableStruct("table3", cellsArray, kNoColumnHeader,
    1.58 +                      "Test Table",
    1.59 +                      "this is a test table for nsIAccessibleTable");
    1.60 +
    1.61 +      //////////////////////////////////////////////////////////////////////////
    1.62 +      // row and column spans
    1.63 +
    1.64 +      cellsArray = [
    1.65 +        [kDataCell, kDataCell,   kDataCell,   kColSpanned, kDataCell, kDataCell,   kDataCell, kDataCell],
    1.66 +        [kDataCell, kDataCell,   kDataCell,   kDataCell,   kDataCell, kDataCell,   kDataCell, kRowSpanned],
    1.67 +        [kDataCell, kDataCell,   kColSpanned, kDataCell,   kDataCell, kDataCell,   kDataCell, kRowSpanned],
    1.68 +        [kDataCell, kRowSpanned, kSpanned,    kDataCell,   kDataCell, kRowSpanned, kDataCell, kRowSpanned]
    1.69 +      ];
    1.70 +
    1.71 +      testTableStruct("table4", cellsArray);
    1.72 +
    1.73 +      SimpleTest.finish();
    1.74 +    }
    1.75 +
    1.76 +    SimpleTest.waitForExplicitFinish();
    1.77 +    addA11yLoadEvent(doTest);
    1.78 +  </script>
    1.79 +</head>
    1.80 +<body>
    1.81 +
    1.82 +  <a target="_blank"
    1.83 +     title="Fix our nsHTMLAccessibleTable class so GetIndexAt and GetRowAtIndex and GetColumnAtIndex behave consistently"
    1.84 +     href="https://bugzilla.mozilla.org/show_bug.cgi?id=410052">Mozilla Bug 410052</a>
    1.85 +  <a target="_blank"
    1.86 +     title="GetCellDataAt callers that expect an error if no cell is found are wrong"
    1.87 +     href="https://bugzilla.mozilla.org/show_bug.cgi?id=417912">Mozilla Bug 417912</a>
    1.88 +  <a target="_blank"
    1.89 +     title="create accessibles for HTML tr"
    1.90 +     href="https://bugzilla.mozilla.org/show_bug.cgi?id=493695">Mozilla Bug 493695</a>
    1.91 +  <a target="_blank"
    1.92 +     title="implement IAccessibleTable2"
    1.93 +     href="https://bugzilla.mozilla.org/show_bug.cgi?id=512424">Mozilla Bug 512424</a>
    1.94 +
    1.95 +  <p id="display"></p>
    1.96 +  <div id="content" style="display: none"></div>
    1.97 +  <pre id="test">
    1.98 +  </pre>
    1.99 +
   1.100 +  <table id="table1">
   1.101 +    <thead>
   1.102 +      <tr>
   1.103 +        <th rowspan="2">col1</th><th colspan="2">col2</th>
   1.104 +      </tr>
   1.105 +      <tr>
   1.106 +        <th>col2sub1</th><th>col2sub2</th>
   1.107 +      </tr>
   1.108 +    </thead>
   1.109 +    <tbody>
   1.110 +      <tr>
   1.111 +        <td>cell1</td><td>cell2</td><td>cell3</td>
   1.112 +      </tr>
   1.113 +    </tbody>
   1.114 +    <tfoot>
   1.115 +      <tr>
   1.116 +        <th>col1</th><th>col2</th><th>col3</th>
   1.117 +      </tr>
   1.118 +    </tfoot>
   1.119 +  </table>
   1.120 +
   1.121 +  <table id="table2">
   1.122 +    <thead>
   1.123 +      <tr>
   1.124 +        <th id="table1_0">col1</th>
   1.125 +        <th id="table1_1">col2</th>
   1.126 +        <td id="table1_2" scope="col">col3</td>
   1.127 +      </tr>
   1.128 +    </thead>
   1.129 +    <tbody>
   1.130 +      <tr>
   1.131 +        <th id="table1_3">row1</th>
   1.132 +        <td id="table1_4">cell1</td>
   1.133 +        <td id="table1_5">cell2</td>
   1.134 +      </tr>
   1.135 +      <tr>
   1.136 +        <td id="table1_6" scope="row">row2</td>
   1.137 +        <td id="table1_7">cell3</td>
   1.138 +        <td id="table1_8">cell4</td>
   1.139 +      </tr>
   1.140 +    </tbody>
   1.141 +  </table>
   1.142 +
   1.143 +  <table id="table3" border="1"
   1.144 +         summary="this is a test table for nsIAccessibleTable">
   1.145 +    <caption>Test Table</caption>
   1.146 +    <thead>
   1.147 +      <tr>
   1.148 +        <th></th>
   1.149 +        <th>columnHeader_1</th>
   1.150 +        <th id ="col2a">columnHeader_2</th>
   1.151 +        <th>columnHeader_3</th>
   1.152 +      </tr>
   1.153 +    </thead>
   1.154 +    <tr>
   1.155 +      <th id="row2a">rowHeader_1</th>
   1.156 +      <td id="row2b">row1_column1</td>
   1.157 +      <td id ="col2b">row1_column2</td>
   1.158 +      <td id="row2c">row1_column3</td>
   1.159 +    </tr>
   1.160 +    <tr>
   1.161 +      <th>rowHeader_2</th>
   1.162 +      <td>row2_column1</td>
   1.163 +      <td id ="col2c">row2_column2</td>
   1.164 +      <td>row2_column3</td>
   1.165 +    </tr>
   1.166 +  </table>
   1.167 +
   1.168 +  <table id="table4" cellpadding="2" cellspacing="2" border="1" width="50%">
   1.169 +    <tbody>
   1.170 +      <tr>
   1.171 +        <td><br></td>
   1.172 +        <td><br></td>
   1.173 +        <td rowspan="1" colspan="2"><br></td>
   1.174 +        <td><br></td>
   1.175 +        <td><br></td>
   1.176 +        <td><br></td>
   1.177 +        <td rowspan="4" colspan="1"><br></td>
   1.178 +      </tr>
   1.179 +      <tr>
   1.180 +        <td><br></td>
   1.181 +        <td><br></td>
   1.182 +        <td><br></td>
   1.183 +        <td><br></td>
   1.184 +        <td><br></td>
   1.185 +        <td><br></td>
   1.186 +        <td><br></td>
   1.187 +      </tr>
   1.188 +      <tr>
   1.189 +        <td><br></td>
   1.190 +        <td rowspan="2" colspan="2">c1</td>
   1.191 +        <td><br></td>
   1.192 +        <td><br></td>
   1.193 +        <td rowspan="2" colspan="1"><br></td>
   1.194 +        <td><br></td>
   1.195 +      </tr>
   1.196 +      <tr>
   1.197 +        <td><br></td>
   1.198 +        <td><br></td>
   1.199 +        <td><br></td>
   1.200 +        <td><br></td>
   1.201 +      </tr>
   1.202 +    </tbody>
   1.203 +  </table>
   1.204 +
   1.205 +</body>
   1.206 +</html>

mercurial