summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/manual-tests/animate-none.html
blob: 4cb2c8b4fc3d2f95132bb4d9ef3e1209262d0ed7 (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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
  "http://www.w3.org/TR/html4/strict.dtd">

<html>
  <head>
    <meta http-equiv="Content-type" content="text/html; charset=utf-8">
    <title>Testing animation-name: none</title>
    
    <style type="text/css" media="screen">
      div {
        width: 300px;
        height: 100px;
        margin: 10px;
        -webkit-animation-name: 'fail';
        -webkit-animation-duration: 3.5s;
        -webkit-animation-iteration-count: infinite;
        -webkit-animation-direction: alternate;
        -webkit-animation-timing-function: linear;        
      }

      @-webkit-keyframes 'fail' {
        from {
          -webkit-transform: rotate(-90deg);
        }
        to {
          -webkit-transform: rotate(90deg);
        }
      }

      #box1 {
        position: relative;
        background-color: blue;
        -webkit-animation-name: 'sway1';
        -webkit-animation-duration: 2.5s;
        -webkit-animation-iteration-count: infinite;
        -webkit-animation-direction: alternate;
        -webkit-animation-timing-function: linear;
      }
      
      @-webkit-keyframes 'sway1' {
        from {
          -webkit-transform: translate(0, 0);
        }
        to {
          -webkit-transform: translate(200px, 0);
        }
      }
      
      #box2 {
        position: relative;
        background-color: red;
        -webkit-animation-name: 'sway2';
        -webkit-animation-duration: 3s;
        -webkit-animation-iteration-count: infinite;
        -webkit-animation-direction: alternate;
        -webkit-animation-timing-function: linear;
      }
      
      @-webkit-keyframes 'sway2' {
        from {
          -webkit-transform: translate(0px, 0);
        }
        to {
          -webkit-transform: translate(200px, 0);
        }
      }

      #box3 {
        position: relative;
        background-color: green;
        -webkit-animation-name: 'sway3';
        -webkit-animation-duration: 3.5s;
        -webkit-animation-iteration-count: infinite;
        -webkit-animation-direction: alternate;
        -webkit-animation-timing-function: linear;
      }

      @-webkit-keyframes 'sway3' {
        from {
          -webkit-transform: translate(0px, 0);
        }
        to {
          -webkit-transform: translate(200px, 0);
        }
      }

      #box4 {
        position: relative;
        background-color: orange;
        -webkit-animation-name: 'none';
        -webkit-animation-duration: 3s;
        -webkit-animation-iteration-count: infinite;
        -webkit-animation-direction: alternate;
        -webkit-animation-timing-function: linear;
      }

      #box5 {
        position: relative;
        background-color: purple;
        -webkit-animation-name: 'none';
        -webkit-animation-duration: 3s;
        -webkit-animation-iteration-count: infinite;
        -webkit-animation-direction: alternate;
        -webkit-animation-timing-function: linear;
      }

      #box6 {
        position: relative;
        background-color: blue;
        -webkit-animation-name: 'fade', 'sway6';
        -webkit-animation-duration: 3s, 4s;
        -webkit-animation-iteration-count: infinite, infinite;
        -webkit-animation-direction: alternate, alternate;
        -webkit-animation-timing-function: linear, linear;
      }

      @-webkit-keyframes 'sway6' {
        from {
          -webkit-transform: translate(0px, 0);
        }
        to {
          -webkit-transform: translate(200px, 0);
        }
      }

      @-webkit-keyframes 'fade' {
        from {
          opacity: 1.0;
        }
        to {
          opacity: 0.1;
        }
      }

      /* set up animation that should never be run */
      @-webkit-keyframes none {
        from {
          -webkit-transform: translate(200px, 0) rotate(-90deg);
        }
        to {
          -webkit-transform: translate(0px, 0) rotate(90deg);
        }
      }

    </style>
    <script type="text/javascript" charset="utf-8">
      function killanims() {
        console.log("click");
        var box1 = document.getElementById("box1");
        box1.style.webkitAnimationName = '';
        var box2 = document.getElementById("box2");
        box2.style.webkitAnimationName = 'none';
        var box3 = document.getElementById("box3");
        box3.style.webkitAnimationName = "'none'";
        var box6 = document.getElementById("box6");
        box6.style.webkitAnimationName = "none, 'sway6'";
      }
      
      setTimeout(killanims, 2000);
    </script>
  </head>
  <body>
    
    <h2>Testing animation: none</h2>
    
      <p>
        After 2 seconds only the blue rectangles should be
        animating.
      Any resulting animation
      that involves rotation or fading means that this test has FAILED.</p>
    
    <div id="box1">
      This rectangle starts with an animation. After 2 seconds a timer
      will set the animation-name on the element to '' (the empty string).
      The CSS rule should cause the animation to continue.
    </div>

    <div id="box2">
      This rectangle starts with an animation. After 2 seconds a timer
      will set the animation-name on the element to 'none' (as an identifier).
      This should cause the animation to stop.
    </div>

    <div id="box3">
      This rectangle starts with an animation. After 2 seconds a timer
      will set the animation-name on the element to 'none' (as a string).
      This should cause the animation to stop.
    </div>

    <div id="box4">
      This rectangle starts with an animation, but animation-name is
      set to 'none' (as an identifier). No animation should run.
    </div>

    <div id="box5">
      This rectangle starts with an animation, but animation-name is
      set to 'none' (as a string). No animation should run.
    </div>

    <div id="box6">
      This rectangle starts with two animations. After 2 seconds a timer
      will set the animation-name on the fade to 'none'. The other
      animation (horizontal) should continue.
    </div>
    
  </body>
</html>