summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/compositing/reorder-z-with-style.html
blob: de2b0d865facb503fab485c906d84b6fd72f487a (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
<!DOCTYPE html>
<style>
  body {
    transform: translateZ(0);
  }
  #container {
    height: 300px;
    width: 300px;
    background-color: green;
    transform: translateZ(0);
  }

  #parent {
    position: absolute;
    left: 400px;
    width: 300px;
    height: 300px;
    background-color: green;
    -webkit-transform-style: preserve-3d;
  }
  
  #child {
    position: absolute;
    width: 200px;
    height: 200px;
    z-index: -2;
    background-color: red;
    transform: translateZ(0);
  }
</style>
<body>
<div id="container">
  <div id="parent">
    <div id="child"></div>
  </div>
</div>
<script>
if (window.testRunner)
  testRunner.waitUntilDone();

requestAnimationFrame(function() {
  requestAnimationFrame(function() {
    document.getElementById('parent').style.webkitTransformStyle = 'flat';
    setTimeout(function() {
      testRunner.notifyDone();
    });
  });
});
</script>
</body>