Upstream version 8.37.180.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / compositing / squashing / invalidations-with-large-negative-margin.html
1 <!DOCTYPE html>
2 <div style="height:200px;width:600px;overflow:scroll">
3   <div style="position:relative">
4     <div style="height:400px;margin-bottom:-400px;position:relative">
5       <div id="chip" style="width:50px;height:50px;position:absolute;background:lightblue;margin:0"></div>
6     </div>
7   </div>
8 </div>
9
10 <pre id="output" style="display:none"></pre>
11 <script>
12 // Test that moving a RenderLayer that is squashed relative to its squashing container repaints correctly.
13 // In particular, the repaint rect needs to be recorded in the correct position relative to the squashing GraphicsLayer.
14 if (window.testRunner) {
15     testRunner.dumpAsText();
16     testRunner.waitUntilDone();
17 }
18
19 if (window.internals) {
20     window.internals.settings.setLayerSquashingEnabled(true);
21     window.internals.startTrackingRepaints(document);
22 }
23 var updateFunction = function()
24 {
25     document.getElementById('chip').style.left = "400px";
26
27     if (window.internals) {
28         var data = window.internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS);
29         window.internals.stopTrackingRepaints(document);
30         var output = document.getElementById('output');
31         output.textContent = data;
32
33         output.style.display = "block";
34     }
35     if (window.testRunner)
36         testRunner.notifyDone();
37 }
38
39 // Wait two frames before updating the chip's style, so that the document is painted and squashed first.
40 window.requestAnimationFrame(function() {
41     window.requestAnimationFrame(updateFunction);
42 });
43
44
45 </script>