dom/xbl/test/test_bug526178.xhtml

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/xbl/test/test_bug526178.xhtml	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,80 @@
     1.4 +<html xmlns="http://www.w3.org/1999/xhtml" style="display: none">
     1.5 +<!--
     1.6 +https://bugzilla.mozilla.org/show_bug.cgi?id=526178
     1.7 +-->
     1.8 +<head>
     1.9 +  <title>Test for Bug 526178</title>
    1.10 +  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
    1.11 +  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
    1.12 +  <style id="sheet">
    1.13 +    #content * {
    1.14 +      display: block;
    1.15 +      -moz-binding: url("#binding");
    1.16 +    }
    1.17 +  </style>
    1.18 +  <bindings xmlns="http://www.mozilla.org/xbl">
    1.19 +    <binding id="binding">
    1.20 +      <implementation>
    1.21 +        <constructor>
    1.22 +          var win = XPCNativeWrapper.unwrap(window);
    1.23 +          win.logString += this.localName;
    1.24 +          win.bindingDone();
    1.25 +        </constructor>
    1.26 +      </implementation>
    1.27 +    </binding>
    1.28 +  </bindings>
    1.29 +</head>
    1.30 +<body>
    1.31 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=526178">Mozilla Bug 526178</a>
    1.32 +<div id="content">
    1.33 +  <a>
    1.34 +    <b>
    1.35 +      <c/>
    1.36 +    </b>
    1.37 +    <d/>
    1.38 +    <e style="display: inline">
    1.39 +      <f style="display: inline">
    1.40 +        <g style="display: inline"/>
    1.41 +        <h style="display: none"/>
    1.42 +        <i style="display: inline"/>
    1.43 +      </f>
    1.44 +      <j style="display: none"/>
    1.45 +      <k style="display: inline">
    1.46 +        <l style="display: inline"/>
    1.47 +        <m/>
    1.48 +        <n style="display: inline"/>
    1.49 +      </k>
    1.50 +    </e>
    1.51 +    <o style="display: none"/>
    1.52 +    <p/>
    1.53 +  </a>
    1.54 +</div>
    1.55 +<p id="display">
    1.56 +</p>
    1.57 +<pre id="test">
    1.58 +<script type="application/javascript">
    1.59 +<![CDATA[
    1.60 +
    1.61 +/** Test for Bug 526178 **/
    1.62 +var logString = "";
    1.63 +// Add one for the root
    1.64 +var pendingBindings = $("content").getElementsByTagName("*").length + 1;
    1.65 +function bindingDone() {
    1.66 +  if (--pendingBindings == 0) {
    1.67 +    is(logString, "apoeknmljfihgdbchtml");
    1.68 +    SimpleTest.finish();
    1.69 +  }
    1.70 +}
    1.71 +
    1.72 +SimpleTest.waitForExplicitFinish();
    1.73 +
    1.74 +// Have to add the rule for the root dynamically so the binding doesn't try
    1.75 +//  to load before bindingDone() is defined.
    1.76 +$("sheet").sheet.insertRule(':root { -moz-binding: url("#binding"); }', 0);
    1.77 +document.documentElement.style.display = "";
    1.78 +
    1.79 +]]>
    1.80 +</script>
    1.81 +</pre>
    1.82 +</body>
    1.83 +</html>

mercurial