| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <div style="height:200px;width:600px;overflow:scroll"> | 2 <div style="height:200px;width:600px;overflow:scroll"> |
| 3 <div style="position:relative; top: 100px"> | 3 <div style="position:relative; top: 100px"> |
| 4 <div style="height:400px;margin-bottom:-400px;position:relative"> | 4 <div style="height:400px;margin-bottom:-400px;position:relative"> |
| 5 <div style="width:50px;height:50px;position:absolute;margin:0;left: 400px"
> | 5 <div style="width:50px;height:50px;position:absolute;margin:0;left: 400px"
> |
| 6 <div id="chip" style="height: 20px; width: 20px; background: lightgray">
</span> | 6 <div id="chip" style="height: 20px; width: 20px; background: lightgray">
</span> |
| 7 </div> | 7 </div> |
| 8 </div> | 8 </div> |
| 9 </div> | 9 </div> |
| 10 </div> | 10 </div> |
| 11 | 11 |
| 12 <pre id="output" style="display:none"></pre> | 12 <pre id="output" style="display:none"></pre> |
| 13 <script> | 13 <script> |
| 14 // Test that updating the position of a RenderObject that is squashed relative t
o its squashing container, | 14 // Test that updating the position of a RenderObject that is squashed relative t
o its squashing container, |
| 15 // but does not have a RenderLayer, issues the correct repaint rects. | 15 // but does not have a RenderLayer, issues the correct repaint rects. |
| 16 if (window.testRunner) { | 16 if (window.testRunner) { |
| 17 testRunner.dumpAsText(); | 17 testRunner.dumpAsText(); |
| 18 testRunner.waitUntilDone(); | 18 testRunner.waitUntilDone(); |
| 19 window.internals.settings.setLayerSquashingEnabled(true); | |
| 20 } | 19 } |
| 21 var updateFunction = function() { | 20 var updateFunction = function() { |
| 22 if (window.internals) | 21 if (window.internals) |
| 23 window.internals.startTrackingRepaints(document); | 22 window.internals.startTrackingRepaints(document); |
| 24 | 23 |
| 25 document.getElementById('chip').style.backgroundColor = "blue"; | 24 document.getElementById('chip').style.backgroundColor = "blue"; |
| 26 | 25 |
| 27 if (window.internals) { | 26 if (window.internals) { |
| 28 // Repaint should be at x=400px, since that is the position relative to
the squashing layer. | 27 // Repaint should be at x=400px, since that is the position relative to
the squashing layer. |
| 29 var data = window.internals.layerTreeAsText(document, internals.LAYER_TR
EE_INCLUDES_REPAINT_RECTS); | 28 var data = window.internals.layerTreeAsText(document, internals.LAYER_TR
EE_INCLUDES_REPAINT_RECTS); |
| 30 window.internals.stopTrackingRepaints(document); | 29 window.internals.stopTrackingRepaints(document); |
| 31 | 30 |
| 32 var output = document.getElementById('output'); | 31 var output = document.getElementById('output'); |
| 33 output.textContent = data; | 32 output.textContent = data; |
| 34 output.style.display = "block"; | 33 output.style.display = "block"; |
| 35 } | 34 } |
| 36 | 35 |
| 37 if (window.testRunner) | 36 if (window.testRunner) |
| 38 testRunner.notifyDone(); | 37 testRunner.notifyDone(); |
| 39 }; | 38 }; |
| 40 | 39 |
| 41 // Wait two frames before updating the chip's style, so that the document is pai
nted and squashed first. | 40 // Wait two frames before updating the chip's style, so that the document is pai
nted and squashed first. |
| 42 window.requestAnimationFrame(function() { | 41 window.requestAnimationFrame(function() { |
| 43 window.requestAnimationFrame(updateFunction); | 42 window.requestAnimationFrame(updateFunction); |
| 44 }); | 43 }); |
| 45 </script> | 44 </script> |
| OLD | NEW |