summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/transitions/matched-transform-functions.html
blob: 224472dacdc217f9f17c5a1b4b9903434157646c (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
<!DOCTYPE html>

<html>
<head>
  <style>
    #box {
      height: 100px;
      width: 100px;
      background-color: blue;
      -webkit-transition-property: -webkit-transform;
      -webkit-transition-duration: 3s;
      -webkit-transform: translate(0, 0) rotate(0);
    }
    
  </style>
  <script>
    if (window.testRunner) {
      testRunner.dumpAsText();
      testRunner.waitUntilDone();
    }

    function test()
    {
      var c = new WebKitCSSMatrix(window.getComputedStyle(document.getElementById('box')).webkitTransform);      
      var result = (c.f < 200) ? 'PASS' : 'FAIL: transition should still be running, so y < 200';
      document.getElementById('result').innerHTML = result;

      if (window.testRunner)
          testRunner.notifyDone();
    }
    
    function startTest()
    {
      var box = document.getElementById('box');
      box.style.webkitTransform = 'translate(100px, 0) rotate(0)';
      
      window.setTimeout(function() {
        box.style.webkitTransform = 'translate(0, 200px) rotate(10deg)';
        window.setTimeout(function() {
          test();
        }, 200);
      }, 300);
    }
    window.addEventListener('load', startTest, false)
  </script>
</head>
<body>
<p>Box should start moving right, then move down</p>
<div id="box">
</div>

<div id="result">
</div>
</body>
</html>