partially-clipped-visual-rect.html (967B)
1 <!DOCTYPE html> 2 <title>Layout Instability: partially clipped visual rect</title> 3 <link rel="help" href="https://wicg.github.io/layout-instability/" /> 4 <style> 5 6 body { margin: 0; } 7 #clip { width: 150px; height: 600px; overflow: hidden; } 8 #j { position: relative; width: 300px; height: 200px; background: blue; } 9 10 </style> 11 <div id='clip'><div id='j'></div></div> 12 <script src="/resources/testharness.js"></script> 13 <script src="/resources/testharnessreport.js"></script> 14 <script src="resources/util.js"></script> 15 <script> 16 17 promise_test(async () => { 18 const watcher = new ScoreWatcher; 19 20 // Wait for the initial render to complete. 21 await waitForAnimationFrames(2); 22 23 document.querySelector("#j").style.top = "200px"; 24 25 // (clipped width 150px) * (height 200 + movement 200) 26 const expectedScore = computeExpectedScore(150 * (200 + 200), 200); 27 28 await watcher.promise; 29 assert_equals(watcher.score, expectedScore); 30 }, "Partially clipped visual rect."); 31 32 </script>