blob: 4527da55f7bd815ef8f8dd112a5e56ba5cbedffe (
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
54
55
56
57
58
59
60
|
<!DOCTYPE html>
<style>
#stacking {
position: absolute;
width: 200px;
height: 200px;
background-color: lightgreen;
}
#clipper {
width: 100px;
height: 100px;
background-color: lightblue;
z-index: -1;
}
.clipping {
overflow: hidden;
}
#composited {
position: relative;
top: 50px;
width: 100px;
height: 100px;
transform: translateZ(0);
background-color: salmon;
}
#squashed {
position: relative;
top: -50px;
width: 100px;
height: 100px;
background-color: green;
}
</style>
<div id="stacking">
<div id="clipper">
<div id="composited"></div>
<div id="squashed"></div>
</div>
<div>
<pre></pre>
<script>
if (window.testRunner) {
testRunner.dumpAsText();
} else {
alert('This test require window.testRunner.')
}
window.internals.forceCompositingUpdate(document);
document.querySelector('#clipper').className = 'clipping';
window.internals.forceCompositingUpdate(document);
document.querySelector('#clipper').className = '';
window.internals.forceCompositingUpdate(document);
document.querySelector('#clipper').className = 'clipping';
document.querySelector('pre').textContent = internals.layerTreeAsText(document);
</script>
|