| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <style> | 2 <style> |
| 3 #container { | 3 #container { |
| 4 position: absolute; | 4 position: absolute; |
| 5 top: 0; | 5 top: 0; |
| 6 left: 0; | 6 left: 0; |
| 7 right: 0; | 7 right: 0; |
| 8 bottom: 0; | 8 bottom: 0; |
| 9 overflow: scroll; | 9 overflow: scroll; |
| 10 } | 10 } |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 | 39 |
| 40 <script src='../../resources/js-test.js'></script> | 40 <script src='../../resources/js-test.js'></script> |
| 41 | 41 |
| 42 <script> | 42 <script> |
| 43 description('Verifies that scroll children do not create ancestor clipping ' + | 43 description('Verifies that scroll children do not create ancestor clipping ' + |
| 44 'layers in compositor.'); | 44 'layers in compositor.'); |
| 45 | 45 |
| 46 if (window.internals) | 46 if (window.internals) |
| 47 internals.settings.setPreferCompositingToLCDTextEnabled(true); | 47 internals.settings.setPreferCompositingToLCDTextEnabled(true); |
| 48 | 48 |
| 49 function scrollChildHasNoScrollClip(layer) { | 49 function scrollChildHasNoScrollClip(layers) { |
| 50 if (layer.children) { | 50 var found = false; |
| 51 for (var i = 0; i < layer.children.length; i++) { | 51 layers["layers"].forEach(function(layer) { |
| 52 var child = layer.children[i]; | 52 // The only layer that should have a transform in this example is the |
| 53 // The only layer that should have a transform in this example is the | 53 // scroll child. If this is not the case, we have a scroll clip. |
| 54 // scroll child. If this is not the case, we have a scroll clip. | 54 if (layer.transform && layer.hasScrollParent) |
| 55 if (child.transform && child.hasScrollParent) | 55 found = true; |
| 56 return true; | 56 }); |
| 57 | 57 return found; |
| 58 if (scrollChildHasNoScrollClip(child)) | |
| 59 return true; | |
| 60 } | |
| 61 } | |
| 62 return false; | |
| 63 } | 58 } |
| 64 | 59 |
| 65 onload = function() { | 60 onload = function() { |
| 66 if (!window.internals) | 61 if (!window.internals) |
| 67 return; | 62 return; |
| 68 documentLayerTree = JSON.parse(window.internals.layerTreeAsText( | 63 documentLayerTree = JSON.parse(window.internals.layerTreeAsText( |
| 69 document, window.internals.LAYER_TREE_INCLUDES_CLIP_AND_SCROLL_PARENTS)); | 64 document, window.internals.LAYER_TREE_INCLUDES_CLIP_AND_SCROLL_PARENTS)); |
| 70 shouldBe('scrollChildHasNoScrollClip(documentLayerTree)', 'true'); | 65 shouldBe('scrollChildHasNoScrollClip(documentLayerTree)', 'true'); |
| 71 }; | 66 }; |
| 72 </script> | 67 </script> |
| OLD | NEW |