summaryrefslogtreecommitdiffstats
path: root/dom/xbl/test/test_bug526178.xhtml
blob: 602a405a1f258da9331f21cb67401c8de54746ff (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
<html xmlns="http://www.w3.org/1999/xhtml" style="display: none">
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=526178
-->
<head>
  <title>Test for Bug 526178</title>
  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
  <style id="sheet">
    #content * {
      display: block;
      -moz-binding: url("#binding");
    }
  </style>
  <bindings xmlns="http://www.mozilla.org/xbl">
    <binding id="binding">
      <implementation>
        <constructor>
          var win = XPCNativeWrapper.unwrap(window);
          win.logString += this.localName;
          win.bindingDone();
        </constructor>
      </implementation>
    </binding>
  </bindings>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=526178">Mozilla Bug 526178</a>
<div id="content">
  <a>
    <b>
      <c/>
    </b>
    <d/>
    <e style="display: inline">
      <f style="display: inline">
        <g style="display: inline"/>
        <h style="display: none"/>
        <i style="display: inline"/>
      </f>
      <j style="display: none"/>
      <k style="display: inline">
        <l style="display: inline"/>
        <m/>
        <n style="display: inline"/>
      </k>
    </e>
    <o style="display: none"/>
    <p/>
  </a>
</div>
<p id="display">
</p>
<pre id="test">
<script type="application/javascript">
<![CDATA[

/** Test for Bug 526178 **/
var logString = "";
// Add one for the root
var pendingBindings = $("content").getElementsByTagName("*").length + 1;
function bindingDone() {
  if (--pendingBindings == 0) {
    is(logString, "apoeknmljfihgdbchtml");
    SimpleTest.finish();
  }
}

SimpleTest.waitForExplicitFinish();

// Have to add the rule for the root dynamically so the binding doesn't try
//  to load before bindingDone() is defined.
$("sheet").sheet.insertRule(':root { -moz-binding: url("#binding"); }', 0);
document.documentElement.style.display = "";

]]>
</script>
</pre>
</body>
</html>