tor-browser

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

sticky-layout-no-change.html (899B)


      1 <!DOCTYPE html>
      2 <title>Layout Instability: sticky positioned layout no change</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: 3000px"></div>
      8 <div id="sticky" style="position: sticky; width: 200px; height: 300px; bottom: 0">
      9  <div style="will-change: transform; height: 3000px; background: yellow"></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  // This doesn't change layout because the sticky element sticks to the bottom.
     20  sticky.style.marginTop = "-1000px";
     21 
     22  await waitForAnimationFrames(3);
     23  assert_equals(watcher.score, 0);
     24 }, 'Sticky layout no change.');
     25 
     26 </script>