local-shift-without-viewport-shift-2.html (931B)
1 <!DOCTYPE html> 2 <title>Layout Instability: local shift without viewport shift</title> 3 <link rel="help" href="https://wicg.github.io/layout-instability/" /> 4 <style> 5 6 #c { position: relative; width: 300px; height: 100px; scale: 0.1; } 7 #j { position: relative; width: 100px; height: 10px; background: blue; } 8 9 </style> 10 <div id='c'> 11 <div id='j'></div> 12 </div> 13 <script src="/resources/testharness.js"></script> 14 <script src="/resources/testharnessreport.js"></script> 15 <script src="resources/util.js"></script> 16 <script> 17 18 promise_test(async () => { 19 const watcher = new ScoreWatcher; 20 21 // Wait for the initial render to complete. 22 await waitForAnimationFrames(2); 23 24 document.querySelector("#j").style.top = "4px"; 25 26 // Make sure no shift score is reported, since the element didn't move in the 27 // viewport. 28 await waitForAnimationFrames(3); 29 assert_equals(watcher.score, 0); 30 }, "Local shift without viewport shift."); 31 32 </script>