| Nicolás Peña Moreno | 2f23cee | 2021-01-29 15:42:35 | [diff] [blame] | 1 | <!DOCTYPE html> |
| 2 | <title>Layout Instability: opacity:0</title> |
| 3 | <link rel="help" href="https://wicg.github.io/layout-instability/" /> |
| Xianzhu Wang | 48e5e3c | 2021-03-13 00:30:33 | [diff] [blame^] | 4 | <div id="target" style="position: absolute; top: 0; width: 400px; height: 400px; background: blue;"> |
| Nicolás Peña Moreno | 2f23cee | 2021-01-29 15:42:35 | [diff] [blame] | 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> |