dom/xbl/test/test_bug790265.xhtml

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 <?xml version="1.0"?>
     2 <html xmlns="http://www.w3.org/1999/xhtml">
     3 <!--
     4 https://bugzilla.mozilla.org/show_bug.cgi?id=790265
     5 -->
     6 <head>
     7   <title>Test for Bug 790265</title>
     8   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     9   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
    10   <bindings xmlns="http://www.mozilla.org/xbl">
    11     <binding id="binding">
    12       <implementation>
    13         <method name="foo" exposeToUntrustedContent="true">
    14           <body><![CDATA[
    15             return this;
    16           ]]></body>
    17         </method>
    18       </implementation>
    19     </binding>
    20   </bindings>
    21   <style>
    22     #toBind { display: none; }
    23     #toBind.bound { -moz-binding: url(#binding); }
    24   </style>
    25 </head>
    26 <body>
    27 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=790265">Mozilla Bug 790265</a>
    28 <p id="display"></p>
    29 <div id="content">
    30   <div id="toBind">Bound element</div>
    31 </div>
    32 <pre id="test">
    33 <script class="testbody" type="text/javascript">
    34 <![CDATA[
    35   SimpleTest.waitForExplicitFinish();
    36   // Flush out style on $("toBind")
    37   $("toBind").offsetWidth;
    38   ok(!("foo" in $("toBind")), "Should not have binding applied");
    39   is(getComputedStyle($("toBind")).MozBinding, "none",
    40      "Computed binding should be none");
    41   $("toBind").className = "bound";
    42   // Flush the style change, so we kick off the binding load before onload
    43   // fires and thus block onload.
    44   $("toBind").offsetWidth;
    45   addLoadEvent(function() {
    46     ok("foo" in $("toBind"), "Should have binding applied");
    47     is($("toBind").foo(), $("toBind"), "Should have correct return value");
    48     SimpleTest.finish();
    49   });
    50 ]]>
    51 </script>
    52 </pre>
    53 </body>
    54 </html>

mercurial