summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/compositing/iframes/repaint-after-losing-scrollbars.html
blob: 603f38fde1ea22550643ccd2c7b869a50d0e440a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<!DOCTYPE html>
<script src="../../resources/run-after-layout-and-paint.js"></script>
<!-- Tests that overflow controls are repainted after compositing is disabled. There should be three green squares and no visible overflow controls -->
<style>
.composited {
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
    if (window.testRunner)
        testRunner.notifyDone();
}

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.dumpAsTextWithPixelResults();
        testRunner.waitUntilDone();
    }
    runAfterLayoutAndPaint(finishTest);
}
</script>