tor-browser

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

child-shift-with-parent-overflow-hidden.html (1173B)


      1 <!DOCTYPE html>
      2 <title>Layout Instability: parent (with overflow:hidden) and child moved together</title>
      3 <link rel="help" href="https://wicg.github.io/layout-instability/" />
      4 <script src="/resources/testharness.js"></script>
      5 <script src="/resources/testharnessreport.js"></script>
      6 <script src="resources/util.js"></script>
      7 <div id="parent" style="position: relative; width: 200px; height: 200px;
      8                        border: 50px solid blue; overflow: hidden">
      9  <div id="child" style="width: 400px; height: 400px; background: blue"></div>
     10 </div>
     11 <script>
     12 
     13 promise_test(async () => {
     14  const watcher = new ScoreWatcher;
     15 
     16  // Wait for the initial render to complete.
     17  await waitForAnimationFrames(2);
     18 
     19  // Modify the position of the div.
     20  const parent = document.querySelector("#parent");
     21  parent.style.top = '100px';
     22 
     23  // Only the parent area should be reported.
     24  const expectedScore = computeExpectedScore(300 * (300 + 100), 100);
     25 
     26  // Observer fires after the frame is painted.
     27  assert_equals(watcher.score, 0);
     28  await watcher.promise;
     29  assert_equals(watcher.score, expectedScore);
     30 }, 'Parent (with overflow:hidden) and child moved together.');
     31 
     32 </script>