blob: d2095089adee27a71d5a7bff9c44c9eb19371e80 [file] [log] [blame]
<!DOCTYPE html>
<!-- Tests that overflow controls are repainted after compositing is disabled. There should be three green squares and no visible overflow controls -->
<style>
.composited {
-webkit-transform:translateZ(0);
}
.container {
width: 100px;
height:100px;
position:absolute;
background-color: green;
overflow:auto;
border: 0px;
}
</style>
<body onload="test()">
<iframe id="vertical" class="composited container" src="resources/repaint-after-losing-scrollbars-iframe.html"></iframe>
<iframe id="horizontal" class="composited container" style="left: 150px" src="resources/repaint-after-losing-scrollbars-iframe.html"></iframe>
<iframe id="both" class="composited container" style="left: 300px" src="resources/repaint-after-losing-scrollbars-iframe.html"></iframe>
</body>
<script>
function finishTest() {
document.getElementById("vertical").contentDocument.body.classList.remove("tall"); // topmost iframe loses a vertical scrollbar
document.getElementById("horizontal").contentDocument.body.classList.remove("wide"); // middle iframe loses a horizontal scrollbar
document.getElementById("both").contentDocument.body.classList.remove("wide"); // bottom iframe loses both
document.getElementById("both").contentDocument.body.classList.remove("tall"); // bottom iframe loses both
}
function test() {
document.getElementById("vertical").contentDocument.body.classList.add("tall"); // topmost iframe starts with a vertical scrollbar
document.getElementById("horizontal").contentDocument.body.classList.add("wide"); // middle iframe starts with a horizontal scrollbar
document.getElementById("both").contentDocument.body.classList.add("wide"); // bottom iframe starts with both
document.getElementById("both").contentDocument.body.classList.add("tall"); // vertical and horizontal scrollbars
if (window.testRunner) {
testRunner.dumpAsText(true);
testRunner.displayAndTrackRepaints(); // Paint once with all overflow controls visible.
finishTest();
} else
window.setTimeout(finishTest, 5000);
}
</script>