blob: 9fc70f06dc01fb40ac229d23293f2b43db011a93 (
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
|
<!DOCTYPE html>
<head>
<script src="../../resources/run-after-layout-and-paint.js"></script>
<style>
.composited {
transform: translatez(0);
}
.box {
width: 100px;
height: 100px;
}
.behind {
position: absolute;
z-index: 1;
top: 50px;
left: 50px;
background-color: blue;
}
.top {
position: absolute;
z-index: 1;
top: 130px;
left: 130px;
background-color: cyan;
}
#inner {
position:absolute;
top:10px;
left: 10px;
height: 50px; width: 50px;
background-color: lightslategray;
z-index: 2
}
</style>
<script>
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
function runTest()
{
runAfterLayoutAndPaint(executeTestCases);
}
function executeTestCases()
{
window.internals.startTrackingRepaints(document);
document.getElementById('Case1').textContent = window.internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS);
window.internals.stopTrackingRepaints(document);
window.internals.startTrackingRepaints(document);
document.querySelector("#inner").style.backgroundColor = 'red';
document.getElementById('Case2').textContent = window.internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS);
window.internals.stopTrackingRepaints(document);
// Display the test results only after test is done so that it does not affect repaint rect results.
document.getElementById('testResults').style.display = "block";
if (window.testRunner)
testRunner.notifyDone();
}
</script>
</head>
<body onload="runTest()">
<div class="composited box behind"></div>
<div class="box top">
<div id="inner">
</div>
</div>
<div id="testResults" style="display:none">
CASE 1, original layer tree
<pre id="Case1"></pre>
CASE 2, change color of "inner" to red
<pre id="Case2"></pre>
</div>
</body>
|