1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2 "http://www.w3.org/TR/html4/loose.dtd">
6 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
7 <title>Test animation with missing from and to keyframes</title>
8 <style type="text/css" media="screen">
15 background-color: blue;
16 -webkit-animation-duration: 2s;
17 -webkit-animation-timing-function: linear;
21 -webkit-animation-name: anim1;
23 @-webkit-keyframes anim1 {
31 -webkit-animation-name: anim2;
32 background-color: red;
34 @-webkit-keyframes anim2 {
42 -webkit-animation-name: anim3;
43 background-color: green;
45 @-webkit-keyframes anim3 {
52 -webkit-animation-name: anim4;
53 background-color: yellow;
55 @-webkit-keyframes anim4 {
61 -webkit-animation-name: anim5;
62 background-color: orange;
64 @-webkit-keyframes anim5 {
71 <script src="resources/animation-test-helpers.js" type="text/javascript" charset="utf-8"></script>
72 <script type="text/javascript" charset="utf-8">
74 const expectedValues = [
75 // [animation-name, time, element-id, property, expected-value, tolerance]
76 ["anim1", 0.4, "box1", "left", 20, 2],
77 ["anim1", 1.0, "box1", "left", 20, 2],
78 ["anim1", 1.6, "box1", "left", 15, 2],
79 ["anim2", 0.4, "box2", "left", 20, 2],
80 ["anim2", 1.0, "box2", "left", 20, 2],
81 ["anim2", 1.6, "box2", "left", 15, 2],
82 ["anim3", 0.4, "box3", "left", 20, 2],
83 ["anim3", 1.0, "box3", "left", 20, 2],
84 ["anim3", 1.6, "box3", "left", 15, 2],
85 ["anim4", 0.4, "box4", "left", 20, 2],
86 ["anim4", 1.0, "box4", "left", 25, 2],
87 ["anim4", 1.6, "box4", "left", 15, 2]
90 runAnimationTest(expectedValues, function() {
91 if (window.testRunner) {
92 var box5Element = document.getElementById('box5');
93 if (internals.pauseAnimationAtTimeOnElement("anim5", 0.1, box5Element))
94 result += "FAIL - box5 animation was running<br>";
96 result += "PASS - box5 animation was not running<br>";
103 This test performs animations of the left property on five boxes over 2 seconds.
104 Box 1 has all keyframes. Box 2 has a missing "from" keyframe.
105 Box 3 has a missing "to" keyframe.
106 Box 4 has both "from" and "to" keyframes missing, but other keyframes which
107 should trigger the generation of "from" and "to". Box 5 has no keyframes, and
109 The test takes 3 snapshots each and expects each result to be within a specified range.
110 <div class="box" id="box1">
112 <div class="box" id="box2">
114 <div class="box" id="box3">
116 <div class="box" id="box4">
118 <div class="box" id="box5">