tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

iframe-append-to-child-document.html (602B)


      1 <!doctype html>
      2 <meta charset=utf-8>
      3 <title>Append iframe element to its own child document</title>
      4 <script src="/resources/testharness.js"></script>
      5 <script src="/resources/testharnessreport.js"></script>
      6 <iframe id=x></iframe>
      7 <script>
      8 test(function() {
      9  var iframe = document.getElementById('x');
     10  var childWindow = iframe.contentWindow;
     11  assert_equals(childWindow.parent, window);
     12  childWindow.document.body.appendChild(iframe);
     13  assert_equals(childWindow.parent, null);
     14  assert_equals(iframe.contentWindow, null);
     15  assert_equals(childWindow.document.body.firstChild, iframe);
     16 });
     17 </script>