1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/xbl/test/test_bug468210.xhtml Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,51 @@ 1.4 +<html xmlns="http://www.w3.org/1999/xhtml"> 1.5 +<!-- 1.6 +https://bugzilla.mozilla.org/show_bug.cgi?id=468210 1.7 +--> 1.8 +<head> 1.9 + <title>Test for Bug 468210</title> 1.10 + <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> 1.11 + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 1.12 + <!-- Keep the stuff inside <content> without spaces, so that the getAnonymousNodes works right --> 1.13 + <bindings xmlns="http://www.mozilla.org/xbl"> 1.14 + <binding id="foo"> 1.15 + <content><span xmlns='http://www.w3.org/1999/xhtml'><children xmlns="http://www.mozilla.org/xbl"/></span></content> 1.16 + </binding> 1.17 + </bindings> 1.18 +</head> 1.19 +<body> 1.20 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=468210">Mozilla Bug 468210</a> 1.21 +<p id="display"> 1.22 + <div id="d" style="-moz-binding: url(#foo);"></div> 1.23 + <a name="foo"></a> 1.24 +</p> 1.25 +<div id="content" style="display: none"> 1.26 + 1.27 +</div> 1.28 +<pre id="test"> 1.29 +<script type="application/javascript"> 1.30 +<![CDATA[ 1.31 + 1.32 +/** Test for Bug 468210 **/ 1.33 +SimpleTest.waitForExplicitFinish(); 1.34 +addLoadEvent(function() { 1.35 + var div = $("d"); 1.36 + var n = document.anchors.length; 1.37 + is(n, 1, "Unexpected number of anchors"); 1.38 + var anon = SpecialPowers.wrap(document).getAnonymousNodes(div)[0]; 1.39 + ok(SpecialPowers.call_Instanceof(anon, HTMLSpanElement), "Unexpected node"); 1.40 + is(SpecialPowers.unwrap(anon.parentNode), div, "Unexpected parent"); 1.41 + document.body.appendChild(div); 1.42 + is(anon.parentNode, null, "Parent should have become null"); 1.43 + // An attr set to test notifications 1.44 + anon.setAttribute("h", "i"); 1.45 +}); 1.46 +addLoadEvent(SimpleTest.finish); 1.47 + 1.48 + 1.49 + 1.50 +]]> 1.51 +</script> 1.52 +</pre> 1.53 +</body> 1.54 +</html>