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 {
30 background-color: blue;
31 -webkit-animation-duration:
1s;
32 -webkit-animation-name: anim-step-middle;
34 * Set initial timing function to something other than the default (ease)
35 * to check that attempts to set easing to step-middle result in the
36 * default, not the initial, being used.
38 -webkit-animation-timing-function: linear;
40 @-webkit-keyframes anim-step-middle {
48 -webkit-animation-timing-function: ease;
51 -webkit-animation-timing-function: linear;
54 -webkit-animation-timing-function: step-start;
57 -webkit-animation-timing-function: step-end;
60 -webkit-animation-timing-function: steps(
3);
63 -webkit-animation-timing-function: steps(
3, start);
66 -webkit-animation-timing-function: steps(
3, end);
69 * The step-middle functions are invalid except through the Web Animations API
70 * and should behave like 'ease', unless step-middle has been added to the CSS specification.
73 -webkit-animation-timing-function: steps(
3, middle);
76 -webkit-animation-timing-function: step-middle;
80 <script src=
"resources/animation-test-helpers.js" type=
"text/javascript" charset=
"utf-8"></script>
81 <script type=
"text/javascript" charset=
"utf-8">
83 const expectedValues = [
84 // [time, element-id, property, expected-value, tolerance]
85 [
0.25,
"box1",
"left",
141,
5],
86 [
0.50,
"box1",
"left",
180,
5],
87 [
0.75,
"box1",
"left",
196,
5],
88 [
0.25,
"box2",
"left",
141,
5],
89 [
0.50,
"box2",
"left",
180,
5],
90 [
0.75,
"box2",
"left",
196,
5],
91 [
0.25,
"box3",
"left",
125,
5],
92 [
0.50,
"box3",
"left",
150,
5],
93 [
0.75,
"box3",
"left",
175,
5],
94 [
0.25,
"box4",
"left",
200,
5],
95 [
0.50,
"box4",
"left",
200,
5],
96 [
0.75,
"box4",
"left",
200,
5],
97 [
0.25,
"box5",
"left",
100,
5],
98 [
0.50,
"box5",
"left",
100,
5],
99 [
0.75,
"box5",
"left",
100,
5],
100 [
0.25,
"box6",
"left",
100,
5],
101 [
0.50,
"box6",
"left",
133,
5],
102 [
0.75,
"box6",
"left",
166,
5],
103 [
0.25,
"box7",
"left",
133,
5],
104 [
0.50,
"box7",
"left",
166,
5],
105 [
0.75,
"box7",
"left",
200,
5],
106 [
0.25,
"box8",
"left",
100,
5],
107 [
0.50,
"box8",
"left",
133,
5],
108 [
0.75,
"box8",
"left",
166,
5],
109 [
0.25,
"box9",
"left",
141,
5],
110 [
0.50,
"box9",
"left",
180,
5],
111 [
0.75,
"box9",
"left",
196,
5],
112 [
0.25,
"box10",
"left",
141,
5],
113 [
0.50,
"box10",
"left",
180,
5],
114 [
0.75,
"box10",
"left",
196,
5],
117 runAnimationTest(expectedValues);
122 This test performs an animation of the left property. It animates over
1 second.
123 It takes
3 snapshots and expects each result to be within a specified range.
124 <div class=
"box" id=
"box1">
126 <div class=
"box" id=
"box2">
128 <div class=
"box" id=
"box3">
130 <div class=
"box" id=
"box4">
132 <div class=
"box" id=
"box5">
134 <div class=
"box" id=
"box6">
136 <div class=
"box" id=
"box7">
138 <div class=
"box" id=
"box8">
140 <div class=
"box-step-middle" id=
"box9">
142 <div class=
"box-step-middle" id=
"box10">