Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / compositing / squashing / squashed-layer-loses-graphicslayer.html
blobbde6aef9ce6f8f8c5fe2542fe001d3993efff71a
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../resources/run-after-layout-and-paint.js"></script>
5 <style>
6 div {
7 position: absolute;
8 z-index: 1;
9 width: 100px;
10 height: 100px;
13 .composited {
14 transform: translatez(0);
17 .underneath {
18 top: 60px;
19 left: 60px;
20 background-color: gray;
23 .overlap1 {
24 top: 140px;
25 left: 140px;
26 background-color: blue;
29 .overlap2 {
30 top: 220px;
31 left: 220px;
32 background-color: lime;
35 .overlap3 {
36 top: 300px;
37 left: 300px;
38 background-color: magenta;
41 div:hover {
42 background-color: green;
43 transform: none;
46 .green {
47 background-color: green;
50 #testResults {
51 display: none;
54 </style>
55 <script>
56 if (window.testRunner) {
57 testRunner.dumpAsText();
58 testRunner.waitUntilDone();
61 function runTest()
63 if (!window.internals)
64 return;
65 runAfterLayoutAndPaint(executeTestCases);
68 function executeTestCases()
70 // Case 1
71 document.getElementById('Case1').textContent = window.internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS);
73 // Case 2
74 window.internals.startTrackingRepaints(document);
75 document.getElementById("forceComposited").className = "underneath";
76 document.getElementById('Case2').textContent = window.internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS);
77 window.internals.stopTrackingRepaints(document);
79 // Display the test results only after test is done so that it does not affect repaint rect results.
80 document.getElementById('testResults').style.display = "block";
82 if (window.testRunner)
83 testRunner.notifyDone();
85 </script>
86 </head>
88 <body onload="runTest()">
90 <p>A squashing Layer that becomes non-composited should correctly send
91 a repaint invalidation to the new container GraphicsLayer that it paints
92 into. When run interactively, hovering over the force-composited gray div
93 should not cause other layers to disappear.</p>
95 <div id="forceComposited" class="composited underneath"></div>
96 <div id="A" class="overlap1"></div>
97 <div id="B" class="overlap2"></div>
98 <div id="C" class="overlap3"></div>
100 <div id="testResults">
101 CASE 1, original layer tree:
102 <pre id="Case1"></pre>
104 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:
105 <pre id="Case2"></pre>
107 </div>
109 </body>
111 </html>