Wed, 31 Dec 2014 06:09:35 +0100
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=330925
4 -->
5 <head>
6 <title>Test for Bug 330925</title>
7 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
8 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
10 <style type="text/css">
11 #t {
12 -moz-binding: url(#randomxbl);
13 }
14 </style>
16 <bindings xmlns="http://www.mozilla.org/xbl">
17 <binding id="randomxbl" inheritstyle="false">
18 <content>
19 xbl textnode1
20 <div>
21 xbl textnode2
22 <children xmlns="http://www.mozilla.org/xbl"/>
23 </div>
24 </content>
25 </binding>
26 </bindings>
28 </head>
29 <body>
30 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=330925">Mozilla Bug 330925</a>
32 <p id="display">
33 <div id="t" />
34 </p>
36 <pre id="test">
37 <script class="testbody" type="text/javascript">
38 <![CDATA[
40 /** Test for Bug 330925 **/
42 // We have to wait until onload because XBL doesn't bind immediately.
43 SimpleTest.waitForExplicitFinish();
44 addLoadEvent(init);
46 function init()
47 {
48 var t = document.getElementById("t");
49 var d = SpecialPowers.wrap(document);
51 is(SpecialPowers.unwrap(d.getBindingParent(d.getAnonymousNodes(t)[0])),
52 t,
53 "Wrong binding parent for anonymous node");
55 is(SpecialPowers.unwrap(d.getBindingParent(d.getAnonymousNodes(t)[1].childNodes[0])),
56 t,
57 "Wrong binding parent for child of anonymous node");
59 is(d.getBindingParent(t),
60 null,
61 "Non-anonymous node should not have a binding parent");
63 is(d.getBindingParent(document.documentElement),
64 null,
65 "Document element should not have a binding parent");
67 SimpleTest.finish();
68 }
70 ]]>
71 </script>
72 </pre>
73 </body>
74 </html>