4 <script src=
"../../resources/run-after-layout-and-paint.js"></script>
7 transform: translatez(
0);
12 background-color: lightgray;
20 background-color: cyan;
24 background-color: lime;
51 if (window
.testRunner
) {
52 testRunner
.waitUntilDone();
53 testRunner
.dumpAsText();
57 internals
.settings
.setPreferCompositingToLCDTextEnabled(true);
61 if (!window
.internals
)
66 return new Promise(function(resolve
) {
68 document
.getElementById('Case1').textContent
= window
.internals
.layerTreeAsText(document
, internals
.LAYER_TREE_INCLUDES_REPAINT_RECTS
);
73 })().then(function() {
75 return new Promise(function(resolve
) {
78 window
.internals
.startTrackingRepaints(document
);
79 window
.scrollTo(0, 80);
80 runAfterLayoutAndPaint(function() {
81 document
.getElementById('Case2').textContent
= window
.internals
.layerTreeAsText(document
, internals
.LAYER_TREE_INCLUDES_REPAINT_RECTS
);
82 window
.internals
.stopTrackingRepaints(document
);
91 return new Promise(function(resolve
) {
94 window
.internals
.startTrackingRepaints(document
);
95 window
.scrollTo(0, 120);
96 runAfterLayoutAndPaint(function() {
97 document
.getElementById('Case3').textContent
= window
.internals
.layerTreeAsText(document
, internals
.LAYER_TREE_INCLUDES_REPAINT_RECTS
);
98 window
.internals
.stopTrackingRepaints(document
);
107 return new Promise(function(resolve
) {
110 window
.internals
.startTrackingRepaints(document
);
111 window
.scrollTo(0, 170);
112 runAfterLayoutAndPaint(function() {
113 document
.getElementById('Case4').textContent
= window
.internals
.layerTreeAsText(document
, internals
.LAYER_TREE_INCLUDES_REPAINT_RECTS
);
114 window
.internals
.stopTrackingRepaints(document
);
123 // Display the test results only after test is done so that it does not affect repaint rect results.
124 document
.getElementById('testResults').style
.display
= "block";
126 if (window
.testRunner
)
127 testRunner
.notifyDone();
129 }).catch(function(e
) {
138 <body onload=
"runTest()">
140 <div id=
"description">
141 <p>The gray div is a composited fixed-position element, and the cyan/lime
142 elements should be squashed together on top. When scrolling, paragraphs may
143 pop in-and-out of the squashing layer when they change overlapping status
144 with respect to the composited layer underneath.
</p>
146 <p>This scenario tests (
1) that content repaints correctly as layers pop in
147 and out of squashing, and (
2) that the positioning of the squashing layer
148 remains correct (i.e. scrolls properly) when the squashing layer is on top
149 of a fixed-position composited layer.
</p>
152 <div class=
"composited background"> </div>
154 <div id=
"paragraph-a" class=
"overlapping cyan"></div>
155 <div id=
"paragraph-b" class=
"overlapping lime"></div>
156 <div id=
"paragraph-c" class=
"overlapping cyan"></div>
157 <div id=
"paragraph-d" class=
"overlapping lime"></div>
158 <div id=
"paragraph-e" class=
"overlapping cyan"></div>
159 <div id=
"paragraph-f" class=
"overlapping lime"></div>
160 <div id=
"paragraph-g" class=
"overlapping cyan"></div>
161 <div id=
"paragraph-h" class=
"overlapping lime"></div>
162 <div id=
"paragraph-i" class=
"overlapping cyan"></div>
163 <div id=
"paragraph-j" class=
"overlapping lime"></div>
164 <div id=
"paragraph-k" class=
"overlapping cyan"></div>
165 <div id=
"paragraph-l" class=
"overlapping lime"></div>
166 <div id=
"paragraph-m" class=
"overlapping cyan"></div>
167 <div id=
"paragraph-n" class=
"overlapping lime"></div>
169 <div id=
"testResults">
170 CASE
1, original layer tree:
171 <pre id=
"Case1"></pre>
173 CASE
2, scrolling y to
80, new layers will be squashed, so things repaint:
174 <pre id=
"Case2"></pre>
176 CASE
3, scrolling y to
120, no repaints expected:
177 <pre id=
"Case3"></pre>
179 CASE
4, scrolling y to
170 new layers will be squashed, so things repaint:
180 <pre id=
"Case4"></pre>