OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
| 4 <script src="../../resources/run-after-display.js"></script> |
4 <style> | 5 <style> |
5 div { | 6 div { |
6 position: absolute; | 7 position: absolute; |
7 z-index: 1; | 8 z-index: 1; |
8 width: 100px; | 9 width: 100px; |
9 height: 100px; | 10 height: 100px; |
10 } | 11 } |
11 | 12 |
12 .composited { | 13 .composited { |
13 -webkit-transform: translatez(0); | 14 -webkit-transform: translatez(0); |
(...skipping 27 matching lines...) Expand all Loading... |
41 .green { | 42 .green { |
42 background-color: green; | 43 background-color: green; |
43 } | 44 } |
44 | 45 |
45 #testResults { | 46 #testResults { |
46 display: none; | 47 display: none; |
47 } | 48 } |
48 | 49 |
49 </style> | 50 </style> |
50 <script> | 51 <script> |
51 if (window.testRunner) | 52 if (window.testRunner) { |
52 testRunner.dumpAsText(); | 53 testRunner.dumpAsText(); |
| 54 testRunner.waitUntilDone(); |
| 55 } |
53 | 56 |
54 if (window.internals) | 57 if (window.internals) |
55 internals.settings.setLayerSquashingEnabled(true); | 58 internals.settings.setLayerSquashingEnabled(true); |
56 | 59 |
57 function runTest() | 60 function runTest() |
58 { | 61 { |
59 if (!window.internals) | 62 if (!window.internals) |
60 return; | 63 return; |
| 64 runAfterDisplay(executeTestCases); |
| 65 } |
61 | 66 |
62 testRunner.display(); | 67 function executeTestCases() |
63 | 68 { |
64 // Case 1 | 69 // Case 1 |
65 document.getElementById('Case1').textContent = window.internals.layerTre
eAsText(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS); | 70 document.getElementById('Case1').textContent = window.internals.layerTre
eAsText(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS); |
66 | 71 |
67 // Case 2 | 72 // Case 2 |
68 window.internals.startTrackingRepaints(document); | 73 window.internals.startTrackingRepaints(document); |
69 document.getElementById("A").style.backgroundColor = "green"; | 74 document.getElementById("A").style.backgroundColor = "green"; |
70 document.getElementById('Case2').textContent = window.internals.layerTre
eAsText(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS); | 75 document.getElementById('Case2').textContent = window.internals.layerTre
eAsText(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS); |
71 window.internals.stopTrackingRepaints(document); | 76 window.internals.stopTrackingRepaints(document); |
72 | 77 |
73 // Case 3 | 78 // Case 3 |
(...skipping 12 matching lines...) Expand all Loading... |
86 | 91 |
87 // Case 5 | 92 // Case 5 |
88 window.internals.startTrackingRepaints(document); | 93 window.internals.startTrackingRepaints(document); |
89 document.getElementById("C").style.backgroundColor = "blue"; | 94 document.getElementById("C").style.backgroundColor = "blue"; |
90 document.getElementById("A").style.backgroundColor = "green"; | 95 document.getElementById("A").style.backgroundColor = "green"; |
91 document.getElementById('Case5').textContent = window.internals.layerTre
eAsText(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS); | 96 document.getElementById('Case5').textContent = window.internals.layerTre
eAsText(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS); |
92 window.internals.stopTrackingRepaints(document); | 97 window.internals.stopTrackingRepaints(document); |
93 | 98 |
94 // Display the test results only after test is done so that it does not
affect repaint rect results. | 99 // Display the test results only after test is done so that it does not
affect repaint rect results. |
95 document.getElementById('testResults').style.display = "block"; | 100 document.getElementById('testResults').style.display = "block"; |
| 101 |
| 102 if (window.testRunner) |
| 103 testRunner.notifyDone(); |
96 } | 104 } |
97 </script> | 105 </script> |
98 </head> | 106 </head> |
99 | 107 |
100 <body onload="runTest()"> | 108 <body onload="runTest()"> |
101 | 109 |
102 <p>Basic repaint test for squashed layers. The entire squashing layer should n
ot need repainting when | 110 <p>Basic repaint test for squashed layers. The entire squashing layer should n
ot need repainting when |
103 only a portion of it is invalidated. Test interactively by using --show-paint-
rects and hovering | 111 only a portion of it is invalidated. Test interactively by using --show-paint-
rects and hovering |
104 over elements to change their color.</p> | 112 over elements to change their color.</p> |
105 | 113 |
(...skipping 15 matching lines...) Expand all Loading... |
121 CASE 4, overlap2 and overlap3 change color: | 129 CASE 4, overlap2 and overlap3 change color: |
122 <pre id="Case4"></pre> | 130 <pre id="Case4"></pre> |
123 | 131 |
124 CASE 5, overlap3 and overlap1 change color: | 132 CASE 5, overlap3 and overlap1 change color: |
125 <pre id="Case5"></pre> | 133 <pre id="Case5"></pre> |
126 </div> | 134 </div> |
127 | 135 |
128 </body> | 136 </body> |
129 | 137 |
130 </html> | 138 </html> |
OLD | NEW |