| 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>Test animation with missing from and to keyframes</title> | 7 <title>Test animation with missing from and to keyframes</title> |
| 8 <style type="text/css" media="screen"> | 8 <style type="text/css" media="screen"> |
| 9 .box { | 9 .box { |
| 10 position: relative; | 10 position: relative; |
| 11 left: 10px; | 11 left: 10px; |
| 12 top: 10px; | 12 top: 10px; |
| 13 height: 20px; | 13 height: 20px; |
| 14 width: 20px; | 14 width: 20px; |
| 15 transform: translateX(10px); | 15 transform: translateX(10px); |
| 16 background-color: blue; | 16 background-color: blue; |
| 17 -webkit-animation-duration: 2s; | 17 animation-duration: 2s; |
| 18 -webkit-animation-timing-function: linear; | 18 animation-timing-function: linear; |
| 19 } | 19 } |
| 20 | 20 |
| 21 #box1 { | 21 #box1 { |
| 22 -webkit-animation-name: anim1; | 22 animation-name: anim1; |
| 23 } | 23 } |
| 24 @-webkit-keyframes anim1 { | 24 @keyframes anim1 { |
| 25 from { transform: translateX(10px); } | 25 from { transform: translateX(10px); } |
| 26 40% { transform: translateX(30px); } | 26 40% { transform: translateX(30px); } |
| 27 60% { transform: translateX(10px); } | 27 60% { transform: translateX(10px); } |
| 28 to { transform: translateX(20px); } | 28 to { transform: translateX(20px); } |
| 29 } | 29 } |
| 30 | 30 |
| 31 #box2 { | 31 #box2 { |
| 32 -webkit-animation-name: anim2; | 32 animation-name: anim2; |
| 33 background-color: red; | 33 background-color: red; |
| 34 } | 34 } |
| 35 @-webkit-keyframes anim2 { | 35 @keyframes anim2 { |
| 36 40% { transform: translateX(30px); } | 36 40% { transform: translateX(30px); } |
| 37 60% { transform: translateX(10px); } | 37 60% { transform: translateX(10px); } |
| 38 to { transform: translateX(20px); } | 38 to { transform: translateX(20px); } |
| 39 } | 39 } |
| 40 | 40 |
| 41 #box3 { | 41 #box3 { |
| 42 transform: translateX(20px); | 42 transform: translateX(20px); |
| 43 -webkit-animation-name: anim3; | 43 animation-name: anim3; |
| 44 background-color: green; | 44 background-color: green; |
| 45 } | 45 } |
| 46 @-webkit-keyframes anim3 { | 46 @keyframes anim3 { |
| 47 from { transform: translateX(10px); } | 47 from { transform: translateX(10px); } |
| 48 40% { transform: translateX(30px); } | 48 40% { transform: translateX(30px); } |
| 49 60% { transform: translateX(10px); } | 49 60% { transform: translateX(10px); } |
| 50 } | 50 } |
| 51 | 51 |
| 52 #box4 { | 52 #box4 { |
| 53 -webkit-animation-name: anim4; | 53 animation-name: anim4; |
| 54 background-color: yellow; | 54 background-color: yellow; |
| 55 } | 55 } |
| 56 @-webkit-keyframes anim4 { | 56 @keyframes anim4 { |
| 57 40% { transform: translateX(30px); } | 57 40% { transform: translateX(30px); } |
| 58 60% { transform: translateX(20px); } | 58 60% { transform: translateX(20px); } |
| 59 } | 59 } |
| 60 | 60 |
| 61 #result { | 61 #result { |
| 62 margin-top: 20px; | 62 margin-top: 20px; |
| 63 } | 63 } |
| 64 </style> | 64 </style> |
| 65 <script src="resources/animation-test-helpers.js" type="text/javascript" chars
et="utf-8"></script> | 65 <script src="resources/animation-test-helpers.js" type="text/javascript" chars
et="utf-8"></script> |
| 66 <script type="text/javascript" charset="utf-8"> | 66 <script type="text/javascript" charset="utf-8"> |
| 67 | 67 |
| 68 const expectedValues = [ | 68 const expectedValues = [ |
| 69 // [time, element-id, property, expected-value, tolerance] | 69 // [time, element-id, property, expected-value, tolerance] |
| 70 [0.4, "box1", "webkitTransform.4", 20, 2], | 70 [0.4, "box1", "transform.4", 20, 2], |
| 71 [1.0, "box1", "webkitTransform.4", 20, 2], | 71 [1.0, "box1", "transform.4", 20, 2], |
| 72 [1.6, "box1", "webkitTransform.4", 15, 2], | 72 [1.6, "box1", "transform.4", 15, 2], |
| 73 [0.4, "box2", "webkitTransform.4", 20, 2], | 73 [0.4, "box2", "transform.4", 20, 2], |
| 74 [1.0, "box2", "webkitTransform.4", 20, 2], | 74 [1.0, "box2", "transform.4", 20, 2], |
| 75 [1.6, "box2", "webkitTransform.4", 15, 2], | 75 [1.6, "box2", "transform.4", 15, 2], |
| 76 [0.4, "box3", "webkitTransform.4", 20, 2], | 76 [0.4, "box3", "transform.4", 20, 2], |
| 77 [1.0, "box3", "webkitTransform.4", 20, 2], | 77 [1.0, "box3", "transform.4", 20, 2], |
| 78 [1.6, "box3", "webkitTransform.4", 15, 2], | 78 [1.6, "box3", "transform.4", 15, 2], |
| 79 [0.4, "box4", "webkitTransform.4", 20, 2], | 79 [0.4, "box4", "transform.4", 20, 2], |
| 80 [1.0, "box4", "webkitTransform.4", 25, 2], | 80 [1.0, "box4", "transform.4", 25, 2], |
| 81 [1.6, "box4", "webkitTransform.4", 15, 2] | 81 [1.6, "box4", "transform.4", 15, 2] |
| 82 ]; | 82 ]; |
| 83 | 83 |
| 84 runAnimationTest(expectedValues); | 84 runAnimationTest(expectedValues); |
| 85 | 85 |
| 86 </script> | 86 </script> |
| 87 </head> | 87 </head> |
| 88 <body> | 88 <body> |
| 89 This test performs animations of the transform property on four boxes over 2 sec
onds. | 89 This test performs animations of the transform property on four boxes over 2 sec
onds. |
| 90 Box 1 has all keyframes. Box 2 has a missing "from" keyframe. | 90 Box 1 has all keyframes. Box 2 has a missing "from" keyframe. |
| 91 Box 3 has a missing "to" keyframe. | 91 Box 3 has a missing "to" keyframe. |
| 92 Box 4 has both "from" and "to" keyframes missing, but other keyframes which | 92 Box 4 has both "from" and "to" keyframes missing, but other keyframes which |
| 93 should trigger the generation of "from" and "to". Box 5 has no keyframes, and | 93 should trigger the generation of "from" and "to". Box 5 has no keyframes, and |
| 94 should not animate. | 94 should not animate. |
| 95 The test takes 3 snapshots each and expects each result to be within a specified
range. | 95 The test takes 3 snapshots each and expects each result to be within a specified
range. |
| 96 <div class="box" id="box1"> | 96 <div class="box" id="box1"> |
| 97 </div> | 97 </div> |
| 98 <div class="box" id="box2"> | 98 <div class="box" id="box2"> |
| 99 </div> | 99 </div> |
| 100 <div class="box" id="box3"> | 100 <div class="box" id="box3"> |
| 101 </div> | 101 </div> |
| 102 <div class="box" id="box4"> | 102 <div class="box" id="box4"> |
| 103 </div> | 103 </div> |
| 104 <div id="result"> | 104 <div id="result"> |
| 105 </div> | 105 </div> |
| 106 </body> | 106 </body> |
| 107 </html> | 107 </html> |
| OLD | NEW |