tor-browser

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

child-out-of-viewport.tentative.html (892B)


      1 <!DOCTYPE html>
      2 <meta charset="utf-8">
      3 <title>Child frame marked as frozen</title>
      4 <script src="/resources/testharness.js"></script>
      5 <script src="/resources/testharnessreport.js"></script>
      6 <body>
      7 <div style="width: 200px; height: 4000px"></div>
      8 <script>
      9 async_test((t) => {
     10 
     11  var child = document.createElement('iframe');
     12 
     13  var loaded = false;
     14  var frozen = false;
     15 
     16  window.addEventListener('message', t.step_func((e) => {
     17    if (e.data == "load") {
     18      loaded = true;
     19    } else if (e.data == "freeze") {
     20      assert_true(loaded);
     21      frozen = true;
     22      child.scrollIntoView();
     23    } else if (e.data == "resume") {
     24      assert_true(loaded);
     25      assert_true(frozen);
     26      t.done();
     27    }
     28  }));
     29 
     30  child.allow = "execution-while-out-of-viewport 'none'";
     31  child.src = "resources/subframe.html";
     32  document.body.appendChild(child);
     33 }, "Child frame frozen");
     34 
     35 </script>
     36 </body>