| Steve Kobes | 1a09247 | 2019-11-25 15:54:13 | [diff] [blame] | 1 | <!DOCTYPE html> |
| 2 | <title>Layout Instability: fully clipped visual rect</title> |
| 3 | <link rel="help" href="https://wicg.github.io/layout-instability/" /> |
| 4 | <style> |
| 5 | |
| 6 | body { margin: 0; } |
| 7 | #clip { width: 0px; height: 600px; overflow: hidden; } |
| 8 | #j { position: relative; width: 300px; height: 200px; } |
| 9 | |
| 10 | </style> |
| 11 | <div id='clip'><div id='j'></div></div> |
| 12 | <script src="/resources/testharness.js"></script> |
| 13 | <script src="/resources/testharnessreport.js"></script> |
| 14 | <script src="resources/util.js"></script> |
| 15 | <script> |
| 16 | |
| 17 | promise_test(async () => { |
| 18 | const watcher = new ScoreWatcher; |
| 19 | |
| 20 | // Wait for the initial render to complete. |
| 21 | await waitForAnimationFrames(2); |
| 22 | |
| 23 | // Shift an element that is fully clipped by its container. |
| 24 | document.querySelector("#j").style.top = "200px"; |
| 25 | |
| 26 | await waitForAnimationFrames(3); |
| 27 | assert_equals(watcher.score, 0); |
| 28 | }, "Fully clipped visual rect."); |
| 29 | |
| 30 | </script> |
| 31 | |
| 32 | |