dom/xbl/test/test_bug400705.xhtml

branch
TOR_BUG_3246
changeset 7
129ffea94266
equal deleted inserted replaced
-1:000000000000 0:d06b8525bfc9
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">
22
23 </div>
24 <pre id="test">
25 <script class="testbody" type="text/javascript">
26 <![CDATA[
27 /** Test for Bug 400705 **/
28 SimpleTest.waitForExplicitFinish();
29
30 addLoadEvent(function() {
31 window.countera = 0;
32 window.counterb = 0;
33
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");
38
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>
48

mercurial