content/base/test/test_bug626262.html

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 <!DOCTYPE HTML>
     2 <html>
     3 <!--
     4 https://bugzilla.mozilla.org/show_bug.cgi?id=626262
     5 -->
     6 <head>
     7   <title>Test for Bug 626262</title>
     8   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     9   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
    10 </head>
    11 <body>
    12 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=626262">Mozilla Bug 626262</a>
    13 <p id="display"><iframe id="f" src="data:text/html,1"></iframe></p>
    14 <div id="content" style="display: none">
    16 </div>
    17 <pre id="test">
    18 <script type="application/javascript">
    20 /** Test for Bug 626262 **/
    21 SimpleTest.waitForExplicitFinish();
    23 addLoadEvent(function() {
    24   var iframe = document.getElementById("f");
    25   var frameDoc = iframe.contentDocument;
    26   var parent = frameDoc.createElementNS("http://www.w3.org/1999/xhtml", "div");
    28   function a()
    29   {
    30     window.removeEventListener("DOMNodeRemoved", arguments.callee, false);
    31     document.adoptNode(parent);
    32   }
    34   var text = document.createTextNode(" ");
    35   document.documentElement.appendChild(text);
    37   var thrown = false;
    38   try {
    39     window.addEventListener("DOMNodeRemoved", a, false);
    40     parent.appendChild(text);
    41   }
    42   catch (e) {
    43     thrown = true;
    44   }
    46   ok(!thrown, "changing ownerDocument during adoptNode should not throw");
    48   SimpleTest.finish();
    49 });
    51 </script>
    52 </pre>
    53 </body>
    54 </html>

mercurial