blob: 35282bb3212ce23a12981d6e727dad08039fbb1a (
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
46
47
48
49
50
51
52
53
|
<!DOCTYPE HTML>
<style>
body {
height: 100%;
margin: 0;
}
#container {
height: 100vh;
overflow-x: hidden;
overflow-y: auto;
perspective: 200px;
perspective-origin: top left;
}
.scrolled {
position: absolute;
}
#fg {
width: 100px;
height: 100px;
background: blue;
left: 100px;
top: 100px;
/* This causes fg to be separately composited, removing the need for the
squashing containment layer. Should have no visible effect. */
will-change: transform;
}
#bg {
transform: translateZ(-100px);
background: green;
width: 800px;
height: 800px;
}
#tall {
width: 10px;
height: 8000px;
background: white;
}
</style>
<script>
if (window.internals)
window.internals.settings.setPreferCompositingToLCDTextEnabled(true);
</script>
<div id="container">
<div class="scrolled" id="bg"></div>
<div class="scrolled" id="fg"></div>
<div id="tall"></div>
</div>
|