summaryrefslogtreecommitdiffstats
path: root/accessible/tests/mochitest/tree/test_display_contents.html
blob: 8393a35b41792df91fcf2f514aa8c30482f94917 (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
<!DOCTYPE html>
<html>

<head>
<title>CSS display:contents tests</title>
<link rel="stylesheet" type="text/css"
      href="chrome://mochikit/content/tests/SimpleTest/test.css" />

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

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

<script type="application/javascript">
function doTest() {
  let tree =
    { LIST: [
      { LISTITEM: [
        { LISTITEM_MARKER: [] },
        { TEXT_LEAF: [] },
      ]},
      { LISTITEM: [
        { LISTITEM_MARKER: [] },
        { TEXT_LEAF: [] },
      ]},
    ] };
  testAccessibleTree("ul", tree);

  tree =
    { TABLE: [
      { ROW: [
        { CELL: [{ TEXT_LEAF: [] } ] },
        { CELL: [{ TEXT_LEAF: [] } ] },
      ]},
    ] };
  testAccessibleTree("tableTableContents", tree);
  testAccessibleTree("tableTrContents", tree);
  testAccessibleTree("tableTdContents", tree);

  tree =
  { TABLE: [
    { GROUPING : [
      { ROW: [
        { CELL: [{ TEXT_LEAF: [] } ] },
        { CELL: [{ TEXT_LEAF: [] } ] },
      ]},
    ]},
  ] };
  testAccessibleTree("tableTbodyContents", tree);


  SimpleTest.finish();
}

SimpleTest.waitForExplicitFinish();
addA11yLoadEvent(doTest);
</script>
</head>
<body>
  <p id="display"></p>
  <div id="content" style="display: none"></div>
  <pre id="test">
  </pre>

  <ul id="ul" style="display: contents;">
    <li>Supermarket 1</li>
    <li>Supermarket 2</li>
  </ul>

  <!-- The summary attribute in these tables ensures they are treated as data
    tables. -->
  <table id="tableTableContents" summary="summary" style="display: contents;">
    <tr><td>a</td><td>b</td></tr>
  </table>
  <table id="tableTrContents" summary="table" style="display: block;">
    <tr style="display: contents;"><td>a</td><td>b</td></tr>
  </table>
  <table id="tableTdContents" summary="summary">
    <tr>
      <td style="display: contents;">a</td>
      <td style="display: contents;">b</td>
    </tr>
  </table>
  <table id="tableTbodyContents" summary="summary" style="display: block;">
    <tbody style="display: contents;">
      <tr><td>a</td><td>b</td></tr>
    </tbody>
  </table>
</body>
</html>