move-transformed.html (886B)
1 <!DOCTYPE html> 2 <title>Layout Instability: shift of a transformed container</title> 3 <link rel="help" href="https://wicg.github.io/layout-instability/" /> 4 <style> 5 body { margin: 0; } 6 #transformed { position: relative; transform: translateX(20px); width: 100px; height: 100px; background: blue; } 7 </style> 8 <div id="transformed"></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 document.querySelector("#transformed").style = "top: 50px"; 21 22 const expectedScore = computeExpectedScore(100 * (100 + 50), 50); 23 24 await watcher.promise; 25 assert_equals(watcher.score, expectedScore); 26 }, 'Move transformed container'); 27 28 </script>