summaryrefslogtreecommitdiffstats
path: root/layout/reftests/display-list/1443027-2.html
blob: 55a632ab1d07e6843b247e3a4edf78aae42a6640 (plain)
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<!DOCTYPE html>
<html lang="en" class="reftest-wait"><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"><meta charset="utf-8">
<title>Bug 1443027 - Test merging across multiple paints</title>

<style>

body { opacity: 0.9; }

div {
  position: absolute;
}

#A {
  left: 250px;
  top: 50px;
  width: 100px;
  height: 100px;
  background-color: red;
}

#B {
  left: 200px;
  top: 0px;
  width: 100px;
  height: 100px;
  background-color: yellow;
}

#C {
  left: 0px;
  top: 0px;
  width: 100px;
  height: 100px;
  background-color: green;
}

#D {
  left: 80px;
  top: 20px;
  width: 140px;
  height: 100px;
  background-color: blue;
}

</style>
</head>
<body>
<div id="A"></div>
<div id="B"></div>
<div id="C"></div>
<div id="D"></div>

<script>

var A = document.getElementById("A");
var B = document.getElementById("B");
var C = document.getElementById("C");
var D = document.getElementById("D");

A.style.visibility = "hidden";
B.style.visibility = "hidden";
C.style.visibility = "hidden";
D.style.visibility = "hidden";

window.addEventListener("MozReftestInvalidate", step1);

function step1() {
  A.style.visibility = "visible";
  A.style.transform = "translatez(1px)";
  B.style.visibility = "visible";
  B.style.transform = "translatez(1px)";
  D.style.visibility = "visible";
  D.style.transform = "translatez(1px)";

  window.requestAnimationFrame(function() { window.requestAnimationFrame(step2); });
}

function step2() {
  C.style.visibility = "visible";
  C.style.transform = "translatez(1px)";

  window.requestAnimationFrame(step3);
}

function step3() {
  D.style.visibility = "hidden";
  D.style.transform = "";
  document.documentElement.removeAttribute('class');
}

</script>
</body></html>