summaryrefslogtreecommitdiffstats
path: root/accessible/tests/mochitest/table/test_indexes_ariagrid.html
blob: 62ef0ed9d55657e92414bac39c9342dbf7356841 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<!DOCTYPE html>
<html>
<head>
  <title>Table indexes for ARIA grid tests</title>
  <link rel="stylesheet" type="text/css"
        href="chrome://mochikit/content/tests/SimpleTest/test.css" />

  <script type="application/javascript"
          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>

  <script type="application/javascript"
          src="../common.js"></script>
  <script type="application/javascript"
          src="../attributes.js"></script>
  <script type="application/javascript"
          src="../table.js"></script>

  <script type="application/javascript">
    function doTest()
    {
      //////////////////////////////////////////////////////////////////////////
      // ARIA grid
      var idxes = [
        [0, 1, 2],
        [3, 4, 5],
        [6, 7, 8],
        [9, 10, 11]
      ];
      testTableIndexes("grid", idxes);

      idxes = [
        [0, 1, 2],
        [3, 4, 5],
        [6, 7, 8],
        [9, 10, 11]
      ];
      testTableIndexes("grid-rowgroups", idxes);

      //////////////////////////////////////////////////////////////////////////
      // a bit crazy ARIA grid
      idxes = [
        [0, 1],
        [2, 3]
      ];
      testTableIndexes("grid2", idxes);

      SimpleTest.finish();
    }

    SimpleTest.waitForExplicitFinish();
    addA11yLoadEvent(doTest);
  </script>
</head>
<body>

  <a target="_blank"
     href="https://bugzilla.mozilla.org/show_bug.cgi?id=386813"
     title="support nsIAccessibleTable on ARIA grid/treegrid">Mozilla Bug 386813</a>
  <a target="_blank"
     title="nsHTMLTableCellAccessible is used in dojo's crazy ARIA grid"
     href="https://bugzilla.mozilla.org/show_bug.cgi?id=513848">Mozilla Bug 513848</a>
  <a target="_blank"
     title="ARIA grid with rowgroup breaks table row/col counting and indices"
     href="https://bugzilla.mozilla.org/show_bug.cgi?id=761853">Mozilla Bug 761853</a>

  <p id="display"></p>
  <div id="content" style="display: none"></div>
  <pre id="test">
  </pre>

  <div role="grid" id="grid">
    <div role="row">
      <span role="columnheader">column1</span>
      <span role="columnheader">column2</span>
      <span role="columnheader">column3</span>
    </div>
    <div role="row">
      <span role="rowheader">row1</span>
      <span role="gridcell">cell1</span>
      <span role="gridcell">cell2</span>
    </div>
    <div role="row">
      <span role="rowheader">row2</span>
      <span role="gridcell">cell3</span>
      <span role="gridcell">cell4</span>
    </div>
    <div role="row">
      <span role="rowheader">row3</span>
      <span role="gridcell">cell5</span>
      <span role="gridcell">cell6</span>
    </div>
  </div>

  <div role="grid" id="grid-rowgroups">
    <div role="row">
      <span role="columnheader">grid-rowgroups-col1</span>
      <span role="columnheader">grid-rowgroups-col2</span>
      <span role="columnheader">grid-rowgroups-col3</span>
    </div>
    <div role="rowgroup">
      <div role="row">
        <span role="rowheader">grid-rowgroups-row1</span>
        <span role="gridcell">grid-rowgroups-cell1</span>
        <span role="gridcell">grid-rowgroups-cell2</span>
      </div>
      <div role="row">
        <span role="rowheader">grid-rowgroups-row2</span>
        <span role="gridcell">grid-rowgroups-cell3</span>
        <span role="gridcell">grid-rowgroups-cell4</span>
      </div>
    </div>
    <div role="row">
      <span role="rowheader">grid-rowgroups-row3</span>
      <span role="gridcell">grid-rowgroups-cell5</span>
      <span role="gridcell">grid-rowgroups-cell6</span>
    </div>
  </div>

  <div role="grid" id="grid2">
    <div role="row">
      <table role="presentation">
        <tr>
          <td role="columnheader">header1</td>
          <td role="columnheader">header2</td>
        </tr>
      </table>
    </div>
    <div role="row">
      <table role="presentation">
        <tr>
          <td role="gridcell">cell1</td>
          <td role="gridcell" tabindex="-1">cell2</td>
        </tr>
      </table>
    </div>
  </div>

</body>
</html>