blob: 9ce0f2be9a97ecbeefa6721c239d7c8115adf05d [file] [log] [blame]
Nicolás Peña Moreno2f23cee2021-01-29 15:42:351<!DOCTYPE html>
2<title>Layout Instability: opacity:0</title>
3<link rel="help" href="https://wicg.github.io/layout-instability/" />
Xianzhu Wang48e5e3c2021-03-13 00:30:334<div id="target" style="position: absolute; top: 0; width: 400px; height: 400px; background: blue;">
Nicolás Peña Moreno2f23cee2021-01-29 15:42:355</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
11promise_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>