| <!DOCTYPE HTML> |
| <script> |
| if (window.internals) |
| window.internals.settings.setPreferCompositingToLCDTextEnabled(false); |
| |
| if (window.testRunner) { |
| window.testRunner.dumpAsText(); |
| window.testRunner.waitUntilDone(); |
| } |
| |
| function isUsingCompositedScrolling(layer) { |
| if (layer.bounds[1] == 1000) |
| return true; |
| if (layer.children) { |
| for (var i = 0; i < layer.children.length; i++) { |
| if (isUsingCompositedScrolling(layer.children[i])) |
| return true; |
| } |
| } |
| return false; |
| } |
| |
| var result = ""; |
| onload = function() { |
| |
| if (window.internals) { |
| result += "Should not be using composited scrolling: "; |
| if (!isUsingCompositedScrolling(JSON.parse(window.internals.layerTreeAsText(document)))) |
| result += "Pass.\n"; |
| else |
| result += "Fail.\n" |
| } |
| |
| document.getElementById("scroller").style.webkitTransform = "translateZ(0)"; |
| requestAnimationFrame(function() { |
| if (window.internals) { |
| result += "Should be using composited scrolling (since we're compositing anyhow): "; |
| if (isUsingCompositedScrolling(JSON.parse(window.internals.layerTreeAsText(document)))) |
| result += "Pass.\n"; |
| else |
| result += "Fail.\n" |
| } |
| |
| document.getElementById("scroller").style.webkitTransform = ""; |
| requestAnimationFrame(function() { |
| if (window.internals) { |
| result += "Should not be using composited scrolling (since we've lost our direct reason): "; |
| if (!isUsingCompositedScrolling(JSON.parse(window.internals.layerTreeAsText(document)))) |
| result += "Pass.\n"; |
| else |
| result += "Fail.\n" |
| } |
| |
| if (window.testRunner) { |
| window.testRunner.setCustomTextOutput(result); |
| window.testRunner.notifyDone(); |
| } |
| }); |
| }); |
| } |
| </script> |
| <div id="scroller" style="overflow:scroll; width:100px; height:100px"> |
| <div id="tall" style="background: green; width:50px; height: 1000px"></div> |
| </div> |