tor-browser

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

test_bug1364399.html (1408B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <!--
      4 https://bugzilla.mozilla.org/show_bug.cgi?id=1364399
      5 -->
      6 <head>
      7  <title>Test for Bug 1364399</title>
      8  <script 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=1364399">Mozilla Bug 1364399</a>
     13 <p id="display"></p>
     14 <script class="testbody" type="text/javascript">
     15 
     16 /** Test for Bug 1364399 */
     17 // Non-data: version at dom/base/test/test_bug518104.html
     18 SimpleTest.waitForExplicitFinish();
     19 
     20 function done() {
     21  // document.write should have gotten ignored due to the
     22  // ignore-destructive-writes counter. Then document.close should
     23  // have gotten ignored due to the parser still being not-script-created.
     24  var iframe = document.getElementById("iframe");
     25  var divs = iframe.contentWindow.document.getElementsByTagName("div").length;
     26  is(divs, 2, "<div>s are still there.");
     27  var ps = iframe.contentWindow.document.getElementsByTagName("p").length;
     28  is(ps, 0, "<p> did not get written.");
     29  SimpleTest.finish();
     30 }
     31 
     32 </script>
     33 <div id="content" style="display: none">
     34  <iframe id='iframe' srcdoc="
     35    <div></div><div></div>
     36    <script defer src='data:application/javascript,document.write(&quot;<p></p>&quot;);parent.done();document.close();'></script>">
     37  </iframe>
     38 </div>
     39 <pre id="test">
     40 </pre>
     41 </body>
     42 </html>