[Web Animations] Expose Web Animations CSS integration as an experimental feature
[WebKit-https.git] / LayoutTests / imported / mozilla / css-animations / test_animation-reverse.html
1 <!doctype html><!-- webkit-test-runner [ enableWebAnimationsCSSIntegration=true ] -->
2 <meta charset=utf-8>
3 <script src="../../../resources/testharness.js"></script>
4 <script src="../../../resources/testharnessreport.js"></script>
5 <script src="../resources/testcommon.js"></script>
6 <style>
7 @keyframes anim {
8   to { transform: translate(100px) }
9 }
10 </style>
11 <body>
12 <div id="log"></div>
13 <script>
14 'use strict';
15
16 test(function(t) {
17   var div = addDiv(t, { style: 'animation: anim 100s' });
18   var animation = div.getAnimations()[0];
19   div.style.animation = "";
20   flushComputedStyle(div);
21
22   assert_equals(animation.currentTime, null);
23   animation.reverse();
24
25   assert_equals(animation.currentTime, 100 * MS_PER_SEC,
26     'animation.currentTime should be its effect end');
27 }, 'reverse() from idle state starts playing the animation');
28
29 </script>
30 </body>