summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/compositing/animation/animation-compositing.html
blob: 29c8ab8aad1b45ead5d96294681fa19012857c9d (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
<!DOCTYPE html>

<html>
<head>
  <style type="text/css" media="screen">
    .box {
      height: 100px;
      width: 100px;
      background-color: blue;
    }
    
    .spinning {
      -webkit-animation: spin 2s infinite linear;
    }
    
    @-webkit-keyframes spin {
      from { -webkit-transform: rotate(0); }
      to   { -webkit-transform: rotate(360deg); }
    }
  </style>
  <script type="text/javascript" charset="utf-8">
    if (window.testRunner) {
        testRunner.dumpAsText();
        testRunner.waitUntilDone();
    }

    function doTest()
    {
      var box = document.getElementById('box');
      box.addEventListener('webkitAnimationStart', function() {
        if (window.testRunner) {
            var layers = window.internals.layerTreeAsText(document);
            var result;
            if (layers != "")
              result = "PASS: created compositing layers when animating transform.";
            else
              result = "FAIL: no layers found";
            document.getElementById('result').innerHTML = result;
            testRunner.notifyDone();
        }
      }, false);
      document.getElementById('box').className = 'spinning';
    }

    window.addEventListener('load', doTest, false);
  </script>
</head>
<body>

  <div id="box" class="box"></div>

  <!-- We should create layers, even on platforms that don't support accelerated animation. -->
  <div id="result">Test only works in DRT</div>

</body>
</html>