forked from WebKit/WebKit-http
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontent-gains-scrollbars.html
63 lines (57 loc) · 1.63 KB
/
content-gains-scrollbars.html
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<!DOCTYPE html>
<style>
.container {
width: 100px;
height:100px;
position:absolute;
-webkit-transform:translateZ(0);
overflow:auto;
}
.content {
-webkit-transform: translateZ(0);
position:absolute;
width:10px;
height:10px;
}
.tall {
height:200px;
}
.wide {
width:200px;
}
.resizeWidget {
resize: both;
}
</style>
<pre id="layerTree"></pre>
<div class="container">
<div id="vertical" class="content"></div>
</div>
<div class="container">
<div id="horizontal" class="content"></div>
</div>
<div class="container">
<div id="both" class="content"></div>
</div>
<div id="corner" class="container">
<div class="content"></div>
</div>
<script>
function finishTest() {
document.getElementById("vertical").classList.add("tall"); // topmost div gets a vertical scrollbar
document.getElementById("horizontal").classList.add("wide"); // second div gets a horizontal scrollbar
document.getElementById("both").classList.add("wide"); // third div gets both
document.getElementById("both").classList.add("tall"); // vertical and horizontal scrollbars
document.getElementById("corner").classList.add("resizeWidget"); // bottom div gets a resize corner but no scrollbars
if (window.testRunner) {
testRunner.displayAndTrackRepaints(); // Ensure compositor tree is up to date.
document.getElementById("layerTree").innerText = window.internals.layerTreeAsText(document);
}
}
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.displayAndTrackRepaints(); // Force compositor state to be updated before the container needs any overflow controls
finishTest();
} else
window.setTimeout(finishTest, 0);
</script>