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