| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html lang="en"> | 2 <html lang="en"> |
| 3 <head> | 3 <head> |
| 4 <title>Keyframes test</title> | 4 <title>Keyframes test</title> |
| 5 <style type="text/css" media="screen"> | 5 <style type="text/css" media="screen"> |
| 6 #box { | 6 #box { |
| 7 position: absolute; | 7 position: absolute; |
| 8 left: 0; | 8 left: 0; |
| 9 top: 100px; | 9 top: 100px; |
| 10 height: 100px; | 10 height: 100px; |
| 11 width: 100px; | 11 width: 100px; |
| 12 background-color: blue; | 12 background-color: blue; |
| 13 animation-duration: 1s; | 13 animation-duration: 1s; |
| 14 animation-timing-function: linear; | 14 animation-timing-function: linear; |
| 15 animation-name: anim; | 15 animation-name: anim; |
| 16 animation-fill-mode: forwards; | 16 animation-fill-mode: forwards; |
| 17 } | 17 } |
| 18 </style> | 18 </style> |
| 19 <script src="resources/animation-test-helpers.js" type="text/javascript" cha
rset="utf-8"></script> | 19 <script src="../resources/animation-test-helpers.js" type="text/javascript"
charset="utf-8"></script> |
| 20 <script type="text/javascript" charset="utf-8"> | 20 <script type="text/javascript" charset="utf-8"> |
| 21 | 21 |
| 22 const expectedValues = [ | 22 const expectedValues = [ |
| 23 // [time, element-id, property, expected-value, tolerance] | 23 // [time, element-id, property, expected-value, tolerance] |
| 24 [1, "box", "left", 300, 1], | 24 [1, "box", "left", 300, 1], |
| 25 ]; | 25 ]; |
| 26 var lastSheet = document.styleSheets[document.styleSheets.length - 1]; | 26 var lastSheet = document.styleSheets[document.styleSheets.length - 1]; |
| 27 lastSheet.insertRule("@-webkit-keyframes anim { from { left: 200px; } to { l
eft: 300px;} }", lastSheet.cssRules.length); | 27 lastSheet.insertRule("@-webkit-keyframes anim { from { left: 200px; } to { l
eft: 300px;} }", lastSheet.cssRules.length); |
| 28 runAnimationTest(expectedValues); | 28 runAnimationTest(expectedValues); |
| 29 result += lastSheet.cssRules[lastSheet.cssRules.length - 1].cssText; | 29 result += lastSheet.cssRules[lastSheet.cssRules.length - 1].cssText; |
| 30 result += '<br>'; | 30 result += '<br>'; |
| 31 | 31 |
| 32 </script> | 32 </script> |
| 33 </head> | 33 </head> |
| 34 <body> | 34 <body> |
| 35 This test creates dynamically a prefixed @-webkit-keyframes and verify the outpu
t. | 35 This test creates dynamically a prefixed @-webkit-keyframes and verify the outpu
t. |
| 36 <div id="box"> | 36 <div id="box"> |
| 37 </div> | 37 </div> |
| 38 <div id="result"> | 38 <div id="result"> |
| 39 </div> | 39 </div> |
| 40 </body> | 40 </body> |
| 41 </html> | 41 </html> |
| OLD | NEW |