1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
content / test / data / gpu / pixel_reflected_div.html [blame]
<!DOCTYPE HTML>
<html>
<head>
<meta name="viewport" content="initial-scale=1">
<title>A div with its reflection below which results in multiple render passes</title>
<style type="text/css">
body {
margin: 0px auto;
}
/* Both will-change and -webkit-box-reflect are needed to ensure multiple render
passes. */
#main {
position: absolute;
background-color: #FF8000;
width: 100px;
height: 400px;
will-change: transform;
-webkit-box-reflect: below 100px;
}
</style>
<script>
var frame = 0;
// It's necessary to do an animation prior to sending SUCCESS in order to
// reliably reproduce https://crbug.com/1033279.
function animate() {
frame++;
document.getElementById('main').style.top = '-' + frame + 'px';
if (frame == 300) {
domAutomationController.send("SUCCESS");
return;
}
// Use setTimeout() because window.requestAnimationFrame() doesn't reliably
// reproduce https://crbug.com/1033279.
setTimeout(animate, 20);
}
</script>
</head>
<body onload="animate()">
<div id="main"></div>
</body>
</html>