summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/manual-tests/animation-with-transition.html
blob: 37a758983fc2e0e1be6751f125da11f15752aead (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
<html>
<head>
  <meta http-equiv="Content-type" content="text/html; charset=utf-8">
  <title>simple-animation</title>
  <style type="text/css" media="screen">
    div {
      position: relative;
      left: 10px;
      top: 10px;
      width: 200px;
      height: 200px;
      background-color: #696;
      -webkit-transition: left 5s, top 5s;
    }
    
    .animate {
      -webkit-animation-name: simple;
      -webkit-animation-duration: 2s;
      -webkit-animation-timing-function: linear;
      -webkit-animation-fill-mode: backwards;
    }
    
    @-webkit-keyframes simple {
      50% {
        left: 300px;
      }
      100% {
        left: 80px;
      }
    }
    
    
  </style>
  <script type="text/javascript" charset="utf-8">
    
    function doTransition() {
      var div = document.querySelector("div");
      div.style.left = "200px";
    }
    
    function doAnimation() {
      var div = document.querySelector("div");
      div.className = "animate";
    }
    
  </script>
</head>
<body>
  <p>Testing setting an animation while a transition is running, in the
    case where the animation synthesizes the initial keyframe</p>
  <p>
    Start the transition, then start the animation.</p>
  <p>
    <a href="https://bugs.webkit.org/show_bug.cgi?id=41188">https://bugs.webkit.org/show_bug.cgi?id=41188</a>
  </p>
  <button onclick="doTransition();">Transition</button>
  <button onclick="doAnimation();">Set Animation</button>
<div></div>
</body>
</html>