blob: 8c610557ca2767bce8999e556125e63f005f14f0 (
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
<!DOCTYPE>
<html>
<head>
<title>Switching layer in and out of preserve-3d</title>
<style type="text/css" media="screen">
body {
font-family: 'Lucida Grande', Verdana, Arial;
font-size: 12px;
}
#container {
position: relative;
height: 300px;
width: 300px;
margin: 50px 100px;
border: 2px solid blue;
-webkit-perspective: 500;
}
#parent {
margin: 10px;
width: 280px;
height: 280px;
background-color: yellow;
opacity: 0.8;
-webkit-transform-style: preserve-3d;
transform: rotateX(-60deg) rotateY(40deg);
}
#parent > div {
position: absolute;
top: 40px;
left: 40px;
width: 200px;
height: 200px;
padding: 10px;
-webkit-box-sizing: border-box;
font-family: monospace;
font-size: 12pt;
}
#parent > :first-child {
background-color: green;
opacity:0.7;
transform: translateZ(50px) rotateY(-40deg);
}
</style>
<script type="text/javascript" charset="utf-8">
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
timeout = 100;
function startProgram()
{
setTimeout(function() {
document.getElementById("parent").style.webkitTransformStyle = "flat";
setTimeout(function() {
document.getElementById("parent").style.webkitTransformStyle = "preserve-3d";
if (window.testRunner) {
var layerTree = window.internals.layerTreeAsText(document);
document.getElementById("layerTree").innerHTML = "<pre>" + layerTree + "</pre>";
testRunner.notifyDone();
}
}, timeout);
}, timeout);
}
window.addEventListener('load', startProgram, false)
</script>
</head>
<body>
<p>The green box appear angled out from the yellow box and embedded in it.</p>
<div id="container">
<div id="parent">
<div>transform: translateZ(-100px) rotateY(45deg);</div>
</div>
<div id="layerTree"></div>
</div>
</body>
</html>
|