blob: 3c0ec726b2818e08b61fa7e5858026bb1a800400 [file] [log] [blame]
Xianzhu Wangfb7851d2020-09-17 22:26:571<!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 Wang48e5e3c2021-03-13 00:30:335 <div id="target" style="position: absolute; top: 0; width: 400px; height: 400px; background: blue"></div>
Xianzhu Wangfb7851d2020-09-17 22:26:576</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
12promise_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>