| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <title>Test of animation-direction</title> | |
| 3 <script src="../resources/testharness.js"></script> | |
| 4 <script src="../resources/testharnessreport.js"></script> | |
| 5 <style> | |
| 6 .box { | |
| 7 animation-delay: 1s; | |
| 8 animation-direction: reverse; | |
| 9 animation-duration: 1s; | |
| 10 animation-name: anim; | |
| 11 animation-timing-function: linear; | |
| 12 height: 100px; | |
| 13 left: 100px; | |
| 14 position: relative; | |
| 15 width: 100px; | |
| 16 } | |
| 17 @keyframes anim { | |
| 18 from { left: 200px; } | |
| 19 to { left: 300px; } | |
| 20 } | |
| 21 #none { | |
| 22 animation-fill-mode: none; | |
| 23 background-color: blue; | |
| 24 } | |
| 25 #backwards { | |
| 26 animation-fill-mode: backwards; | |
| 27 background-color: red; | |
| 28 } | |
| 29 #forwards { | |
| 30 animation-fill-mode: forwards; | |
| 31 background-color: green; | |
| 32 } | |
| 33 #both { | |
| 34 animation-fill-mode: both; | |
| 35 background-color: yellow; | |
| 36 } | |
| 37 </style> | |
| 38 <div id="none" class="box"> | |
| 39 None | |
| 40 </div> | |
| 41 <div id="backwards" class="box"> | |
| 42 Backwards | |
| 43 </div> | |
| 44 <div id="forwards" class="box"> | |
| 45 Forwards | |
| 46 </div> | |
| 47 <div id="both" class="box"> | |
| 48 Both | |
| 49 </div> | |
| 50 <script> | |
| 51 'use strict'; | |
| 52 test(function() { | |
| 53 none.style.animationDelay = '1s'; | |
| 54 assert_equals(getComputedStyle(none).left, '100px'); | |
| 55 | |
| 56 backwards.style.animationDelay = '1s'; | |
| 57 assert_equals(getComputedStyle(backwards).left, '300px'); | |
| 58 | |
| 59 forwards.style.animationDelay = '1s'; | |
| 60 assert_equals(getComputedStyle(forwards).left, '100px'); | |
| 61 | |
| 62 both.style.animationDelay = '1s'; | |
| 63 assert_equals(getComputedStyle(both).left, '300px'); | |
| 64 | |
| 65 | |
| 66 none.style.animationDelay = '-5s'; | |
| 67 assert_equals(getComputedStyle(none).left, '100px'); | |
| 68 | |
| 69 backwards.style.animationDelay = '-5s'; | |
| 70 assert_equals(getComputedStyle(backwards).left, '100px'); | |
| 71 | |
| 72 forwards.style.animationDelay = '-5s'; | |
| 73 assert_equals(getComputedStyle(forwards).left, '200px'); | |
| 74 | |
| 75 both.style.animationDelay = '-5s'; | |
| 76 assert_equals(getComputedStyle(both).left, '200px'); | |
| 77 }, "animation directions work with fill modes"); | |
| 78 </script> | |
| OLD | NEW |