Upstream version 11.40.277.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / compositing / squashing / squashing-sparsity-heuristic.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <style>
5 div {
6   position: absolute;
7   z-index: 1;
8   width: 10px;
9   height: 10px;
10 }
11
12 .composited {
13   transform: translatez(0);
14   top: 60px;
15   left: 60px;
16   width: 400px;
17   height: 400px;
18   background-color: gray;
19 }
20
21 .overlap1 {
22   top: 140px;
23   left: 140px;
24   background-color: blue;
25 }
26
27 .overlap2 {
28   top: 220px;
29   left: 220px;
30   background-color: lime;
31 }
32
33 .overlap3 {
34   top: 300px;
35   left: 220px;
36   background-color: green;
37 }
38
39 .overlap4 {
40   top: 300px;
41   left: 235px;
42   background-color: yellow;
43 }
44 </style>
45 <script>
46     if (window.testRunner)
47         testRunner.dumpAsText();
48
49     if (window.internals)
50         internals.settings.setLayerSquashingEnabled(true);
51
52     function dump() {
53         if (!window.internals)
54             return;
55         var layers = document.createElement('pre');
56         layers.innerHTML = window.internals.layerTreeAsText(document);
57         document.body.appendChild(layers);
58     }
59
60     window.onload = dump;
61 </script>
62 </head>
63
64 <body>
65   <!-- 
66   If this test is working correctly, then the first two layers should not
67   squash together (as they would create a layer that's too sparse), but the
68   third and fourth layers should squash together.
69   -->
70   <div class="composited"></div>
71   <div id="A" class="overlap1"></div>
72   <div id="B" class="overlap2"></div>
73   <div id="C" class="overlap3"></div>
74   <div id="D" class="overlap4"></div>
75 </body>
76 </html>