| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <script src="resources/composited-scroll.js"></script> |
| 2 <style> | 3 <style> |
| 3 .composited { | 4 .composited { |
| 4 transform: translateZ(0); | 5 transform: translateZ(0); |
| 5 } | 6 } |
| 6 .scroller { | 7 .scroller { |
| 7 width: 300px; | 8 width: 300px; |
| 8 height: 300px; | 9 height: 300px; |
| 9 overflow: scroll; | 10 overflow: scroll; |
| 10 } | 11 } |
| 11 .scroller > div { | 12 .scroller > div { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 23 <script src='../../resources/run-after-layout-and-paint.js'></script> | 24 <script src='../../resources/run-after-layout-and-paint.js'></script> |
| 24 | 25 |
| 25 <script type='text/javascript'> | 26 <script type='text/javascript'> |
| 26 jsTestIsAsync = true; | 27 jsTestIsAsync = true; |
| 27 description('Verifies that toggling pointer-events correctly updates scrolling '
+ | 28 description('Verifies that toggling pointer-events correctly updates scrolling '
+ |
| 28 'layers in compositor.'); | 29 'layers in compositor.'); |
| 29 | 30 |
| 30 if (window.internals) | 31 if (window.internals) |
| 31 internals.settings.setPreferCompositingToLCDTextEnabled(true); | 32 internals.settings.setPreferCompositingToLCDTextEnabled(true); |
| 32 | 33 |
| 33 function isUsingCompositedScrolling(layer) { | |
| 34 if (layer.bounds[1] == 1000) | |
| 35 return true; | |
| 36 if (layer.children) { | |
| 37 for (var i = 0; i < layer.children.length; i++) { | |
| 38 if (isUsingCompositedScrolling(layer.children[i])) | |
| 39 return true; | |
| 40 } | |
| 41 } | |
| 42 return false; | |
| 43 } | |
| 44 | |
| 45 onload = function() { | 34 onload = function() { |
| 46 documentLayerTree = JSON.parse(window.internals.layerTreeAsText(document)); | 35 documentLayerTree = JSON.parse(window.internals.layerTreeAsText(document)); |
| 47 shouldBe('isUsingCompositedScrolling(documentLayerTree)', 'false'); | 36 shouldBe('isUsingCompositedScrolling(documentLayerTree)', 'false'); |
| 48 | 37 |
| 49 // removing 'pointer-events: none' should cause composited scrolling | 38 // removing 'pointer-events: none' should cause composited scrolling |
| 50 document.getElementById('scroller').style.pointerEvents = ''; | 39 document.getElementById('scroller').style.pointerEvents = ''; |
| 51 runAfterLayoutAndPaint(function() { | 40 runAfterLayoutAndPaint(function() { |
| 52 documentLayerTree = JSON.parse(window.internals.layerTreeAsText(document)); | 41 documentLayerTree = JSON.parse(window.internals.layerTreeAsText(document)); |
| 53 shouldBe('isUsingCompositedScrolling(documentLayerTree)', 'true'); | 42 shouldBe('isUsingCompositedScrolling(documentLayerTree)', 'true'); |
| 54 finishJSTest(); | 43 finishJSTest(); |
| 55 }); | 44 }); |
| 56 }; | 45 }; |
| 57 </script> | 46 </script> |
| OLD | NEW |