tor-browser

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

test_bug765780.html (1403B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <!--
      4 https://bugzilla.mozilla.org/show_bug.cgi?id=765780
      5 -->
      6 <head>
      7  <meta charset="utf-8">
      8  <title>Test for Bug 765780</title>
      9  <script src="/tests/SimpleTest/SimpleTest.js"></script>
     10  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     11  <script type="application/javascript">
     12    /** Test for Bug 765780 */
     13    SimpleTest.waitForExplicitFinish();
     14    window.onload = function() {
     15      var f = $("f");
     16      var doc = f.contentDocument;
     17      doc.designMode = "on";
     18      var s = doc.createElement("script");
     19      s.textContent = "parent.called = true;";
     20 
     21      window.called = false;
     22      doc.body.appendChild(s);
     23      ok(called, "Script in designMode iframe should have run");
     24 
     25      doc = doc.querySelector("iframe").contentDocument;
     26      var s = doc.createElement("script");
     27      s.textContent = "parent.parent.called = true;";
     28 
     29      window.called = false;
     30      doc.body.appendChild(s);
     31      ok(called, "Script in designMode iframe's child should have run");
     32 
     33      SimpleTest.finish();
     34    }
     35  </script>
     36 </head>
     37 <body>
     38 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=765780">Mozilla Bug 765780</a>
     39 <!-- Important: iframe needs to not be display: none -->
     40 <p id="display"><iframe id="f" srcdoc="<iframe></iframe>"></iframe> </p>
     41 <div id="content" style="display: none">
     42 </div>
     43 <pre id="test">
     44 </pre>
     45 </body>
     46 </html>