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 timing functions</title>
8 <style type="text/css" media="screen">
15 background-color: blue;
16 -webkit-animation-duration: 1s;
17 -webkit-animation-name: anim;
19 @-webkit-keyframes anim {
26 -webkit-animation-timing-function: ease;
29 -webkit-animation-timing-function: linear;
32 -webkit-animation-timing-function: step-start;
35 -webkit-animation-timing-function: step-end;
38 -webkit-animation-timing-function: steps(3);
41 -webkit-animation-timing-function: steps(3, start);
44 -webkit-animation-timing-function: steps(3, end);
48 <script src="resources/animation-test-helpers.js" type="text/javascript" charset="utf-8"></script>
49 <script type="text/javascript" charset="utf-8">
51 const expectedValues = [
52 // [animation-name, time, element-id, property, expected-value, tolerance]
53 ["anim", 0.25, "box1", "left", 141, 5],
54 ["anim", 0.50, "box1", "left", 180, 5],
55 ["anim", 0.75, "box1", "left", 196, 5],
56 ["anim", 0.25, "box2", "left", 141, 5],
57 ["anim", 0.50, "box2", "left", 180, 5],
58 ["anim", 0.75, "box2", "left", 196, 5],
59 ["anim", 0.25, "box3", "left", 125, 5],
60 ["anim", 0.50, "box3", "left", 150, 5],
61 ["anim", 0.75, "box3", "left", 175, 5],
62 ["anim", 0.25, "box4", "left", 200, 5],
63 ["anim", 0.50, "box4", "left", 200, 5],
64 ["anim", 0.75, "box4", "left", 200, 5],
65 ["anim", 0.25, "box5", "left", 100, 5],
66 ["anim", 0.50, "box5", "left", 100, 5],
67 ["anim", 0.75, "box5", "left", 100, 5],
68 ["anim", 0.25, "box6", "left", 100, 5],
69 ["anim", 0.50, "box6", "left", 133, 5],
70 ["anim", 0.75, "box6", "left", 166, 5],
71 ["anim", 0.25, "box7", "left", 133, 5],
72 ["anim", 0.50, "box7", "left", 166, 5],
73 ["anim", 0.75, "box7", "left", 200, 5],
74 ["anim", 0.25, "box8", "left", 100, 5],
75 ["anim", 0.50, "box8", "left", 133, 5],
76 ["anim", 0.75, "box8", "left", 166, 5],
79 runAnimationTest(expectedValues);
84 This test performs an animation of the left property. It animates over 1 second.
85 It takes 3 snapshots and expects each result to be within a specified range.
86 <div class="box" id="box1">
88 <div class="box" id="box2">
90 <div class="box" id="box3">
92 <div class="box" id="box4">
94 <div class="box" id="box5">
96 <div class="box" id="box6">
98 <div class="box" id="box7">
100 <div class="box" id="box8">