blob: 795cd85f862beb91072e5b9d37258d4484901bbc [file] [log] [blame]
<!DOCTYPE HTML>
<script src="resources/composited-scroll.js"></script>
<style>
#scroller {
overflow: scroll;
height: 300px;
width: 300px;
background-color: red;
}
#inner {
height: 1000px;
width: 250px;
background-color: blue;
}
#fixed {
position: fixed;
height: 100px;
width: 100px;
background-color: green;
top: 400px;
left: 100px;
}
</style>
<div id="scroller">
<div id="inner">
<div id="fixed"></div>
</div>
</div>
<script>
if (window.internals)
internals.settings.setPreferCompositingToLCDTextEnabled(true);
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
var result = "";
onload = function() {
if (window.internals) {
result += "No clip path descendant (should be using composited scrolling): ";
if (elementSubtreeHasCompositedScrollLayers(document.getElementById('scroller')))
result += "Pass.\n";
else
result += "Fail.\n"
}
document.getElementById("inner").style.webkitClipPath = "polygon(40px 550px,432px 302px,409px 237px,46px 156px)";
requestAnimationFrame(function() {
if (window.internals) {
result += "Has clip path descendant (should not be using composited scrolling): ";
if (!elementSubtreeHasCompositedScrollLayers(document.getElementById('scroller')))
result += "Pass.\n";
else
result += "Fail.\n"
}
if (window.testRunner) {
testRunner.setCustomTextOutput(result);
testRunner.notifyDone();
}
});
};
</script>