tor-browser

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

child-shift-with-parent-overflow-x-clip.html (1089B)


      1 <!DOCTYPE html>
      2 <title>Layout Instability: parent/child moved together with overflow-x: clip</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: 100px; height: 100px; border: 100px solid blue; overflow-x: clip">
      8  <div id="child" style="width: 1000px; height: 300px; background: blue"></div>
      9 </div>
     10 <script>
     11 
     12 promise_test(async () => {
     13  const watcher = new ScoreWatcher;
     14 
     15  // Wait for the initial render to complete.
     16  await waitForAnimationFrames(2);
     17 
     18  // Modify the position of the div.
     19  const parent = document.querySelector("#parent");
     20  parent.style.top = '100px';
     21 
     22  const expectedScore = computeExpectedScore(300 * (400 + 100), 100);
     23 
     24  // Observer fires after the frame is painted.
     25  assert_equals(watcher.score, 0);
     26  await watcher.promise;
     27  assert_equals(watcher.score, expectedScore);
     28 }, 'Parent/child movement with overflow-x: clip.');
     29 
     30 </script>