shift-into-viewport-inline-direction-and-scroll.html (930B)
1 <!DOCTYPE html> 2 <title>Layout Instability: shift into viewport in inline direction with scroll</title> 3 <link rel="help" href="https://wicg.github.io/layout-instability/" /> 4 <style> 5 #j { position: absolute; width: 200px; height: 600px; top: 300px; left: -200px; background: blue; } 6 </style> 7 <div id='j'></div> 8 <div style="width: 5000px; height: 5000px"></div> 9 <script src="/resources/testharness.js"></script> 10 <script src="/resources/testharnessreport.js"></script> 11 <script src="resources/util.js"></script> 12 <script> 13 14 promise_test(async () => { 15 const watcher = new ScoreWatcher; 16 17 // Wait for the initial render to complete. 18 await waitForAnimationFrames(2); 19 20 // Move div into viewport horizontally. 21 document.querySelector("#j").style.left = '400px'; 22 window.scrollTo(300, 300); 23 24 await waitForAnimationFrames(3); 25 assert_equals(watcher.score, 0); 26 }, "Shift into viewport in inline direction with scroll."); 27 28 </script>