| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 | |
| 3 <html> | |
| 4 <head> | |
| 5 <style type="text/css" media="screen"> | |
| 6 | |
| 7 #container { | |
| 8 position: relative; | |
| 9 border: 1px solid black; | |
| 10 height: 100px; | |
| 11 width: 500px; | |
| 12 } | |
| 13 | |
| 14 #box { | |
| 15 position: absolute; | |
| 16 height: 100px; | |
| 17 width: 100px; | |
| 18 background-color: blue; | |
| 19 animation-name: move; | |
| 20 animation-duration: 2s; | |
| 21 animation-direction: alternate; | |
| 22 animation-iteration-count: 2; | |
| 23 animation-timing-function: linear; | |
| 24 } | |
| 25 | |
| 26 @keyframes move { | |
| 27 0% { | |
| 28 left: 0; | |
| 29 } | |
| 30 100% { | |
| 31 left: 400px; | |
| 32 } | |
| 33 } | |
| 34 | |
| 35 </style> | |
| 36 <script src="resources/animation-test-helpers.js" type="text/javascript" chars
et="utf-8"></script> | |
| 37 <script type="text/javascript" charset="utf-8"> | |
| 38 | |
| 39 const expectedValues = [ | |
| 40 // [time, element-id, property, expected-value, tolerance] | |
| 41 [0.5, "box", "left", 100, 20], | |
| 42 [1.5, "box", "left", 300, 20], | |
| 43 | |
| 44 [2.5, "box", "left", 300, 20], | |
| 45 [3.5, "box", "left", 100, 20], | |
| 46 ]; | |
| 47 | |
| 48 runAnimationTest(expectedValues); | |
| 49 </script> | |
| 50 </head> | |
| 51 <body> | |
| 52 | |
| 53 <!-- Test animation-direction: alternate --> | |
| 54 <div id="container"> | |
| 55 <div id="box"></div> | |
| 56 </div> | |
| 57 | |
| 58 <div id="result"></div> | |
| 59 | |
| 60 </body> | |
| 61 </html> | |
| OLD | NEW |