opacity-nonzero-to-zero.html (798B)
1 <!DOCTYPE html> 2 <title>Layout Instability: opacity:0</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; background: blue;"> 5 </div> 6 <script src="/resources/testharness.js"></script> 7 <script src="/resources/testharnessreport.js"></script> 8 <script src="resources/util.js"></script> 9 <script> 10 11 promise_test(async () => { 12 const watcher = new ScoreWatcher; 13 14 // Wait for the initial render to complete. 15 await waitForAnimationFrames(2); 16 17 // Shift target, for which no shift should be reported because it's not visible. 18 target.style.top = '200px'; 19 target.style.opacity = 0; 20 21 await waitForAnimationFrames(2); 22 assert_equals(watcher.score, 0); 23 }, 'opacity non-zero to zero'); 24 25 </script>