dom/xbl/test/test_bug400705.xhtml

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 <html xmlns="http://www.w3.org/1999/xhtml">
     2 <!--
     3 https://bugzilla.mozilla.org/show_bug.cgi?id=400705
     4 -->
     5 <head>
     6   <title>Test for Bug 400705</title>
     7   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     8   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
     9   <bindings xmlns="http://www.mozilla.org/xbl">
    10     <binding id="test">
    11       <implementation>
    12         <field name="a">XPCNativeWrapper.unwrap(window).countera++</field>
    13         <field name="b">XPCNativeWrapper.unwrap(window).counterb++</field>
    14       </implementation>
    15     </binding>
    16   </bindings>
    17 </head>
    18 <body>
    19 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=400705">Mozilla Bug 400705</a>
    20 <p id="display" style="-moz-binding: url(#test)"></p>
    21 <div id="content" style="display: none">
    23 </div>
    24 <pre id="test">
    25 <script class="testbody" type="text/javascript">
    26 <![CDATA[
    27 /** Test for Bug 400705 **/
    28 SimpleTest.waitForExplicitFinish();
    30 addLoadEvent(function() {
    31   window.countera = 0;
    32   window.counterb = 0;
    34   var d = $("display");
    35   // Control to make sure fields are lazy and all
    36   d.a;
    37   is(window.countera, 1, "Should have evaluated field");
    39   d.parentNode.removeChild(d);
    40   is(window.counterb, 0, "Should not evaluate field on binding teardown");
    41   SimpleTest.finish();
    42 });
    43 ]]>
    44 </script>
    45 </pre>
    46 </body>
    47 </html>

mercurial