summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/compositing/layer-creation/animation-overlap-with-children.html
blob: 6289c6b7dd3943ed4c81d17ee85a81165d801e51 (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>

<html>
<head>
  <style>
    
    .animating {
      -webkit-animation: slide 10s alternate linear infinite;
    }
    
    .container {
      height: 200px;
      width: 250px;
      padding: 5px;
      border: 1px solid black;
    }
    
    .banner {
      width: 100%;
      height: 50px;
      background-color: silver;
    }
    
    .box {
      position: relative;
      height: 100px;
      width: 100px;
      margin: 10px;
      background-color: blue;
    }
    
    .test1 {
      position: absolute;
      left: 0;
      top: 10px;
      background-color: orange;
    }

    .test2 {
      position: absolute;
      top: 60px;
      left: 120px;
      background-color: orange;
    }
    
    .composited {
      -webkit-transform: translateZ(0);
    }
    
    @-webkit-keyframes slide {
      from { -webkit-transform: none; }
      to { -webkit-transform: translateX(100px); }
    }
  </style>
  <script>
    if (window.testRunner) {
      testRunner.dumpAsText();
      testRunner.waitUntilDone();
    }
      
    function runTest()
    {
      if (window.testRunner) {
        window.internals.pauseAnimations(0.0);
        document.getElementById('layers').innerText = window.internals.layerTreeAsText(document);
        testRunner.notifyDone();
      }
    }
    window.addEventListener('load', runTest, false);
  </script>
</head>
<body>

  <div id="to-animate" class="container animating">
    <div class="composited banner"></div>
    <div class="test1 box">Should be composited</div>
    <div class="test2 box">Should not be composited</div>
  </div>

  <div class="box">Should be composited</div>
  <pre id="layers">Layer tree goes here in DRT</pre>

</body>
</html>