tor-browser

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

shift-with-overflow-status-change.html (1290B)


      1 <!DOCTYPE html>
      2 <title>Layout Instability: change under overflow clipping container causing shift and overflow status change at the same time</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 style="height: 100px"></div>
      8 <div style="overflow: auto; width: 400px; height: 400px">
      9  <div id="resized" style="width: 600px; height: 100px; background: gray"></div>
     10  <div id="shifted" style="width: 300px; height: 100px; background: blue"></div>
     11 </div>
     12 <script>
     13 promise_test(async () => {
     14  const watcher = new ScoreWatcher;
     15 
     16  // Wait for the initial render to complete.
     17  await waitForAnimationFrames(2);
     18 
     19  resized.style.width = '200px';
     20  resized.style.height = '200px';
     21 
     22  const expectedScore = computeExpectedScore(300 * (100 + 100), 100);
     23 
     24  assert_equals(watcher.score, 0);
     25  await watcher.promise;
     26  assert_equals(watcher.score, expectedScore);
     27 
     28  resized.style.width = '600px';
     29  resized.style.height = '100px';
     30  await watcher.promise;
     31  assert_equals(watcher.score, expectedScore * 2);
     32 }, 'Change under overflow clipping container causing shift and overflow status change at the same time');
     33 </script>