| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <script src="../../resources/testharness.js"></script> | 2 <script src="../../resources/testharness.js"></script> |
| 3 <style> | 3 <style> |
| 4 .scale-transform { | 4 .scale-transform { |
| 5 transform: scale(0.75); | 5 transform: scale(0.75); |
| 6 } | 6 } |
| 7 .translate-transform { | 7 .translate-transform { |
| 8 transform: translateX(5px); | 8 transform: translateX(5px); |
| 9 } | 9 } |
| 10 </style> | 10 </style> |
| 11 <div style="will-change: transform; width: 200px; height: 200px; background: lig
htgray;"></div> | 11 <div style="will-change: transform; width: 200px; height: 200px; background: lig
htgray;"></div> |
| 12 <div class="scale-transform" style="position: absolute; width: 200px; height: 20
0px; top: 100px; left: 100px; background: lightblue"></div> | 12 <div class="scale-transform" style="position: absolute; width: 200px; height: 20
0px; top: 100px; left: 100px; background: lightblue"></div> |
| 13 <div class="translate-transform" style="position: absolute; width: 200px; height
: 200px; top: 100px; left: 100px; background: lightblue"></div> | 13 <div class="translate-transform" style="position: absolute; width: 200px; height
: 200px; top: 100px; left: 100px; background: lightblue"></div> |
| 14 <script> | 14 <script> |
| 15 if (window.testRunner) | 15 if (window.testRunner) |
| 16 testRunner.dumpAsText(); | 16 testRunner.dumpAsText(); |
| 17 onload = function() { | 17 onload = function() { |
| 18 if (window.internals) { | 18 if (window.internals) { |
| 19 var layers = JSON.parse(internals.layerTreeAsText(document, internals.LA
YER_TREE_INCLUDES_DEBUG_INFO)); | 19 var layers = JSON.parse(internals.layerTreeAsText(document, internals.LA
YER_TREE_INCLUDES_DEBUG_INFO))["layers"]; |
| 20 | 20 |
| 21 // The scale-transform layer can't be squashed | 21 // The scale-transform layer can't be squashed |
| 22 assert_true(layers.children[0].children[1].children[0].compositingReason
s[1] == "Layer was separately composited because it could not be squashed."); | 22 assert_true(layers[3].compositingReasons[1] == "Layer was separately com
posited because it could not be squashed."); |
| 23 assert_true(layers.children[0].children[1].children[0].squashingDisallow
edReasons[0] == "Cannot squash layers with transforms that are not identity or t
ranslation."); | 23 assert_true(layers[3].squashingDisallowedReasons[0] == "Cannot squash la
yers with transforms that are not identity or translation."); |
| 24 | 24 |
| 25 // ...but the translate-transform one can. | 25 // ...but the translate-transform one can. |
| 26 assert_true(layers.children[0].children[1].children[1].compositingReason
s[0] == "Secondary layer, home for a group of squashable content"); | 26 assert_true(layers[4].compositingReasons[0] == "Secondary layer, home fo
r a group of squashable content"); |
| 27 } | 27 } |
| 28 }; | 28 }; |
| 29 </script> | 29 </script> |
| OLD | NEW |