summaryrefslogtreecommitdiffstats
path: root/accessible/tests/mochitest/treeupdate/test_bug1100602.html
blob: 1637e50576af350d3a2184379962f3de40f63686 (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
<html>

<head>
  <title>Test hide/show events for HTMLListBulletAccessibles on list restyle</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="../name.js"></script>
  <script type="application/javascript"
          src="../events.js"></script>

  <script type="application/javascript">
    /**
     * Change list style type to none.
     */
    function hideBullet()
    {
      this.eventSeq = [];
      this.liAcc = getAccessible("list_element");
      this.bullet = this.liAcc.firstChild;

      this.eventSeq.push(new invokerChecker(EVENT_HIDE, this.bullet));
      this.eventSeq.push(new invokerChecker(EVENT_REORDER, this.liAcc));

      this.invoke = function hideBullet_invoke()
      {
        getNode("list").setAttribute("style", "list-style-type: none;");
      }

      this.finalCheck = function hideBullet_finalCheck()
      {
        is(this.liAcc.name, "list element",
          "Check that first child of LI is not a bullet.");
      }

      this.getID = function hideBullet_getID()
      {
        return "Hide bullet by setting style to none";
      }
    }

    /**
     * Change list style type to circles.
     */
    function showBullet()
    {
      this.eventSeq = [];
      this.liAcc = getAccessible("list_element");

      this.eventSeq.push(new invokerChecker(EVENT_SHOW,
                                            function(aNode) { return aNode.firstChild; },
                                            this.liAcc));
      this.eventSeq.push(new invokerChecker(EVENT_REORDER, this.liAcc));

      this.invoke = function showBullet_invoke()
      {
        getNode("list").setAttribute("style", "list-style-type: circle;");
      }

      this.finalCheck = function showBullet_finalCheck()
      {
        is(this.liAcc.name, "◦ list element",
          "Check that first child of LI is a circle bullet.");
      }

      this.getID = function showBullet_getID()
      {
        return "Show bullet by setting style to circle";
      }
    }

    var gQueue = null;
    function doTest()
    {

      var list = getNode("list");
      list.setAttribute("style", "list-style-type: circle;");

      gQueue = new eventQueue();
      gQueue.push(new hideBullet());
      gQueue.push(new showBullet());
      gQueue.invoke(); // SimpleTest.finish();
    }

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

</head>

<body>

  <a target="_blank"
     href="https://bugzilla.mozilla.org/show_bug.cgi?id=1100602"
     title="[e10s] crash in mozilla::a11y::ProxyAccessible::Shutdown()">
    Mozilla Bug 1100602
  </a>
  <p id="display"></p>
  <div id="content" style="display: none"></div>
  <pre id="test">
  </pre>

  <ol id="list">
    <li id="list_element">list element</li>
  </ol>

</body>
</html>