visibility-hidden.html (845B)
1 <!DOCTYPE html> 2 <title>Layout Instability: visibility:hidden</title> 3 <link rel="help" href="https://wicg.github.io/layout-instability/" /> 4 <div id="target" style="position: absolute; top: 0; width: 400px; height: 400px; visibility: hidden; background: blue"></div> 5 <script src="/resources/testharness.js"></script> 6 <script src="/resources/testharnessreport.js"></script> 7 <script src="resources/util.js"></script> 8 <script> 9 10 promise_test(async () => { 11 const watcher = new ScoreWatcher; 12 13 // Wait for the initial render to complete. 14 await waitForAnimationFrames(2); 15 16 // Shift target, for which no shift should be reported because it's hidden. 17 document.querySelector("#target").style.top = '200px'; 18 19 await waitForAnimationFrames(2); 20 // No shift should be reported. 21 assert_equals(watcher.score, 0); 22 }, 'visibility:hidden'); 23 24 </script>