dom/xbl/test/test_bug790265.xhtml

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/xbl/test/test_bug790265.xhtml	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,55 @@
     1.4 +<?xml version="1.0"?>
     1.5 +<html xmlns="http://www.w3.org/1999/xhtml">
     1.6 +<!--
     1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=790265
     1.8 +-->
     1.9 +<head>
    1.10 +  <title>Test for Bug 790265</title>
    1.11 +  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
    1.12 +  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
    1.13 +  <bindings xmlns="http://www.mozilla.org/xbl">
    1.14 +    <binding id="binding">
    1.15 +      <implementation>
    1.16 +        <method name="foo" exposeToUntrustedContent="true">
    1.17 +          <body><![CDATA[
    1.18 +            return this;
    1.19 +          ]]></body>
    1.20 +        </method>
    1.21 +      </implementation>
    1.22 +    </binding>
    1.23 +  </bindings>
    1.24 +  <style>
    1.25 +    #toBind { display: none; }
    1.26 +    #toBind.bound { -moz-binding: url(#binding); }
    1.27 +  </style>
    1.28 +</head>
    1.29 +<body>
    1.30 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=790265">Mozilla Bug 790265</a>
    1.31 +<p id="display"></p>
    1.32 +<div id="content">
    1.33 +  <div id="toBind">Bound element</div>
    1.34 +</div>
    1.35 +<pre id="test">
    1.36 +<script class="testbody" type="text/javascript">
    1.37 +<![CDATA[
    1.38 +  SimpleTest.waitForExplicitFinish();
    1.39 +  // Flush out style on $("toBind")
    1.40 +  $("toBind").offsetWidth;
    1.41 +  ok(!("foo" in $("toBind")), "Should not have binding applied");
    1.42 +  is(getComputedStyle($("toBind")).MozBinding, "none",
    1.43 +     "Computed binding should be none");
    1.44 +  $("toBind").className = "bound";
    1.45 +  // Flush the style change, so we kick off the binding load before onload
    1.46 +  // fires and thus block onload.
    1.47 +  $("toBind").offsetWidth;
    1.48 +  addLoadEvent(function() {
    1.49 +    ok("foo" in $("toBind"), "Should have binding applied");
    1.50 +    is($("toBind").foo(), $("toBind"), "Should have correct return value");
    1.51 +    SimpleTest.finish();
    1.52 +  });
    1.53 +]]>
    1.54 +</script>
    1.55 +</pre>
    1.56 +</body>
    1.57 +</html>
    1.58 +

mercurial