Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / compositing / squashing / squashed-layer-loses-graphicslayer.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../resources/run-after-display.js"></script>
5 <style>
6 div {
7   position: absolute;
8   z-index: 1;
9   width: 100px;
10   height: 100px;
11 }
12
13 .composited {
14   transform: translatez(0);
15 }
16
17 .underneath {
18   top: 60px;
19   left: 60px;
20   background-color: gray;
21 }
22
23 .overlap1 {
24   top: 140px;
25   left: 140px;
26   background-color: blue;
27 }
28
29 .overlap2 {
30   top: 220px;
31   left: 220px;
32   background-color: lime;
33 }
34
35 .overlap3 {
36   top: 300px;
37   left: 300px;
38   background-color: magenta;
39 }
40
41 div:hover {
42   background-color: green;
43   transform: none;
44 }
45
46 .green {
47   background-color: green;
48 }
49
50 #testResults {
51   display: none;
52 }
53
54 </style>
55 <script>
56     if (window.testRunner) {
57         testRunner.dumpAsText();
58         testRunner.waitUntilDone();
59     }
60
61     if (window.internals)
62         internals.settings.setLayerSquashingEnabled(true);
63
64     function runTest()
65     {
66         if (!window.internals)
67             return;
68         runAfterDisplay(executeTestCases);
69     }
70
71     function executeTestCases()
72     {
73         // Case 1
74         document.getElementById('Case1').textContent = window.internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS);
75
76         // Case 2
77         window.internals.startTrackingRepaints(document);
78         document.getElementById("forceComposited").className = "underneath";
79         document.getElementById('Case2').textContent = window.internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS);
80         window.internals.stopTrackingRepaints(document);
81
82         // Display the test results only after test is done so that it does not affect repaint rect results.
83         document.getElementById('testResults').style.display = "block";
84
85         if (window.testRunner)
86             testRunner.notifyDone();
87     }
88 </script>
89 </head>
90
91 <body onload="runTest()">
92
93   <p>A squashing RenderLayer that becomes non-composited should correctly send
94      a repaint invalidation to the new container GraphicsLayer that it paints
95      into. When run interactively, hovering over the force-composited gray div
96      should not cause other layers to disappear.</p>
97
98   <div id="forceComposited" class="composited underneath"></div>
99   <div id="A" class="overlap1"></div>
100   <div id="B" class="overlap2"></div>
101   <div id="C" class="overlap3"></div>
102
103   <div id="testResults">
104     CASE 1, original layer tree:
105     <pre id="Case1"></pre>
106
107     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:
108     <pre id="Case2"></pre>
109
110   </div>
111
112 </body>
113
114 </html>