| Xianzhu Wang | fb7851d | 2020-09-17 22:26:57 | [diff] [blame] | 1 | <!DOCTYPE html> |
| 2 | <title>Layout Instability: fully clipped by contain:paint</title> |
| 3 | <link rel="help" href="https://wicg.github.io/layout-instability/" /> |
| 4 | <div style="contain: paint; height: 0; position: relative"> |
| Xianzhu Wang | 48e5e3c | 2021-03-13 00:30:33 | [diff] [blame] | 5 | <div id="target" style="position: absolute; top: 0; width: 400px; height: 400px; background: blue"></div> |
| Xianzhu Wang | fb7851d | 2020-09-17 22:26:57 | [diff] [blame] | 6 | </div> |
| 7 | <script src="/resources/testharness.js"></script> |
| 8 | <script src="/resources/testharnessreport.js"></script> |
| 9 | <script src="resources/util.js"></script> |
| 10 | <script> |
| 11 | |
| 12 | promise_test(async () => { |
| 13 | const watcher = new ScoreWatcher; |
| 14 | |
| 15 | // Wait for the initial render to complete. |
| 16 | await waitForAnimationFrames(2); |
| 17 | |
| 18 | // Shift target, for which no shift should be reported because it's hidden. |
| 19 | document.querySelector("#target").style.top = '200px'; |
| 20 | |
| 21 | await waitForAnimationFrames(2); |
| 22 | // No shift should be reported. |
| 23 | assert_equals(watcher.score, 0); |
| 24 | }, 'fully clipped by contain:paint'); |
| 25 | |
| 26 | </script> |