blob: 1a3f5b351e8634e8724a2b517ffd0cf848128a4c (
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
|
<!DOCTYPE html>
<html>
<head>
<script src="../../resources/run-after-display.js"></script>
<style>
div {
position: absolute;
z-index: 1;
width: 100px;
height: 100px;
}
.composited {
transform: translatez(0);
}
.underneath {
top: 60px;
left: 60px;
background-color: gray;
}
.overlap1 {
top: 140px;
left: 140px;
background-color: blue;
}
.overlap2 {
top: 220px;
left: 220px;
background-color: lime;
}
.overlap3 {
top: 300px;
left: 300px;
background-color: magenta;
}
div:hover {
background-color: green;
transform: none;
}
.green {
background-color: green;
}
#testResults {
display: none;
}
</style>
<script>
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
if (window.internals)
internals.settings.setLayerSquashingEnabled(true);
function runTest()
{
if (!window.internals)
return;
runAfterDisplay(executeTestCases);
}
function executeTestCases()
{
// Case 1
document.getElementById('Case1').textContent = window.internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS);
// Case 2
window.internals.startTrackingRepaints(document);
document.getElementById("forceComposited").className = "underneath";
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()">
<p>A squashing RenderLayer that becomes non-composited should correctly send
a repaint invalidation to the new container GraphicsLayer that it paints
into. When run interactively, hovering over the force-composited gray div
should not cause other layers to disappear.</p>
<div id="forceComposited" class="composited underneath"></div>
<div id="A" class="overlap1"></div>
<div id="B" class="overlap2"></div>
<div id="C" class="overlap3"></div>
<div id="testResults">
CASE 1, original layer tree:
<pre id="Case1"></pre>
CASE 2, The original composited layer is no longer composited, which then also removes all squashing layers. The important point is that there should be an appropriate repaint to the root GraphicsLayer:
<pre id="Case2"></pre>
</div>
</body>
</html>
|