4 <script src="../../resources/run-after-display.js"></script>
14 transform: translatez(0);
17 background-color: gray;
23 background-color: blue;
29 background-color: lime;
35 background-color: magenta;
39 background-color: green;
43 background-color: green;
52 if (window.testRunner) {
53 testRunner.dumpAsText();
54 testRunner.waitUntilDone();
58 internals.settings.setLayerSquashingEnabled(true);
62 if (!window.internals)
64 runAfterDisplay(executeTestCases);
67 function executeTestCases()
70 document.getElementById('Case1').textContent = window.internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS);
73 window.internals.startTrackingRepaints(document);
74 document.getElementById("A").style.backgroundColor = "green";
75 document.getElementById('Case2').textContent = window.internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS);
76 window.internals.stopTrackingRepaints(document);
79 window.internals.startTrackingRepaints(document);
80 document.getElementById("A").style.backgroundColor = "blue";
81 document.getElementById("B").style.backgroundColor = "green";
82 document.getElementById('Case3').textContent = window.internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS);
83 window.internals.stopTrackingRepaints(document);
86 window.internals.startTrackingRepaints(document);
87 document.getElementById("B").style.backgroundColor = "blue";
88 document.getElementById("C").style.backgroundColor = "green";
89 document.getElementById('Case4').textContent = window.internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS);
90 window.internals.stopTrackingRepaints(document);
93 window.internals.startTrackingRepaints(document);
94 document.getElementById("C").style.backgroundColor = "blue";
95 document.getElementById("A").style.backgroundColor = "green";
96 document.getElementById('Case5').textContent = window.internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS);
97 window.internals.stopTrackingRepaints(document);
99 // Display the test results only after test is done so that it does not affect repaint rect results.
100 document.getElementById('testResults').style.display = "block";
102 if (window.testRunner)
103 testRunner.notifyDone();
108 <body onload="runTest()">
110 <p>Basic repaint test for squashed layers. The entire squashing layer should not need repainting when
111 only a portion of it is invalidated. Test interactively by using --show-paint-rects and hovering
112 over elements to change their color.</p>
114 <div class="composited"></div>
115 <div id="A" class="overlap1"></div>
116 <div id="B" class="overlap2"></div>
117 <div id="C" class="overlap3"></div>
119 <div id="testResults">
120 CASE 1, original layer tree:
121 <pre id="Case1"></pre>
123 CASE 2, overlap1 changes color:
124 <pre id="Case2"></pre>
126 CASE 3, overlap1 and overlap2 change color:
127 <pre id="Case3"></pre>
129 CASE 4, overlap2 and overlap3 change color:
130 <pre id="Case4"></pre>
132 CASE 5, overlap3 and overlap1 change color:
133 <pre id="Case5"></pre>