dom/xbl/test/test_bug468210.xhtml

branch
TOR_BUG_9701
changeset 15
b8a032363ba2
equal deleted inserted replaced
-1:000000000000 0:1889488ba5a3
1 <html xmlns="http://www.w3.org/1999/xhtml">
2 <!--
3 https://bugzilla.mozilla.org/show_bug.cgi?id=468210
4 -->
5 <head>
6 <title>Test for Bug 468210</title>
7 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
8 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
9 <!-- Keep the stuff inside <content> without spaces, so that the getAnonymousNodes works right -->
10 <bindings xmlns="http://www.mozilla.org/xbl">
11 <binding id="foo">
12 <content><span xmlns='http://www.w3.org/1999/xhtml'><children xmlns="http://www.mozilla.org/xbl"/></span></content>
13 </binding>
14 </bindings>
15 </head>
16 <body>
17 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=468210">Mozilla Bug 468210</a>
18 <p id="display">
19 <div id="d" style="-moz-binding: url(#foo);"></div>
20 <a name="foo"></a>
21 </p>
22 <div id="content" style="display: none">
23
24 </div>
25 <pre id="test">
26 <script type="application/javascript">
27 <![CDATA[
28
29 /** Test for Bug 468210 **/
30 SimpleTest.waitForExplicitFinish();
31 addLoadEvent(function() {
32 var div = $("d");
33 var n = document.anchors.length;
34 is(n, 1, "Unexpected number of anchors");
35 var anon = SpecialPowers.wrap(document).getAnonymousNodes(div)[0];
36 ok(SpecialPowers.call_Instanceof(anon, HTMLSpanElement), "Unexpected node");
37 is(SpecialPowers.unwrap(anon.parentNode), div, "Unexpected parent");
38 document.body.appendChild(div);
39 is(anon.parentNode, null, "Parent should have become null");
40 // An attr set to test notifications
41 anon.setAttribute("h", "i");
42 });
43 addLoadEvent(SimpleTest.finish);
44
45
46
47 ]]>
48 </script>
49 </pre>
50 </body>
51 </html>

mercurial