tor-browser

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

contain-paint-fully-clipped.html (920B)


      1 <!DOCTYPE html>
      2 <title>Layout Instability: fully clipped by contain:paint</title>
      3 <link rel="help" href="https://wicg.github.io/layout-instability/" />
      4 <div style="contain: paint; height: 0; position: relative">
      5  <div id="target" style="position: absolute; top: 0; width: 400px; height: 400px; background: blue"></div>
      6 </div>
      7 <script src="/resources/testharness.js"></script>
      8 <script src="/resources/testharnessreport.js"></script>
      9 <script src="resources/util.js"></script>
     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  // Shift target, for which no shift should be reported because it's hidden.
     19  document.querySelector("#target").style.top = '200px';
     20 
     21  await waitForAnimationFrames(2);
     22  // No shift should be reported.
     23  assert_equals(watcher.score, 0);
     24 }, 'fully clipped by contain:paint');
     25 
     26 </script>