| <!DOCTYPE HTML> |
| <script src="resources/composited-scroll.js"></script> |
| <script> |
| if (window.internals) |
| internals.settings.setPreferCompositingToLCDTextEnabled(false); |
| |
| if (window.testRunner) { |
| testRunner.dumpAsText(); |
| testRunner.waitUntilDone(); |
| } |
| |
| var result = ""; |
| onload = function() { |
| |
| if (window.internals) { |
| result += "Should not be using composited scrolling: "; |
| if (!elementSubtreeHasCompositedScrollLayers(document.getElementById('scroller'))) |
| 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 (elementSubtreeHasCompositedScrollLayers(document.getElementById('scroller'))) |
| 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 (!elementSubtreeHasCompositedScrollLayers(document.getElementById('scroller'))) |
| result += "Pass.\n"; |
| else |
| result += "Fail.\n" |
| } |
| |
| if (window.testRunner) { |
| testRunner.setCustomTextOutput(result); |
| 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> |