3 <title>Test animation shorthand property
</title>
4 <style type=
"text/css" media=
"screen">
8 background-color: blue;
13 -webkit-animation: none;
16 -webkit-animation: anim1
10s;
19 -webkit-animation: anim1
10s linear;
22 -webkit-animation: anim1
10s linear
5s;
25 -webkit-animation: anim1
10s linear
5s
3;
28 -webkit-animation: anim1
10s linear
5s infinite alternate;
31 -webkit-animation: anim1
10s linear
5s infinite alternate forwards;
34 -webkit-animation: anim1
10s linear normal none;
37 -webkit-animation: anim1
10s linear infinite backwards, anim2
3s none, anim3
5s both;
40 @-webkit-keyframes anim1 { }
41 @-webkit-keyframes anim2 { }
43 <script type=
"text/javascript" charset=
"utf-8">
44 if (window.testRunner)
45 testRunner.dumpAsText();
48 "webkitAnimationName",
49 "webkitAnimationDuration",
50 "webkitAnimationTimingFunction",
51 "webkitAnimationDelay",
52 "webkitAnimationIterationCount",
53 "webkitAnimationDirection",
54 "webkitAnimationFillMode"
56 const kExpectedResults = [
57 { id: 'a', values: [
"none",
"0s",
"ease",
"0s",
"1",
"normal",
"none" ] },
58 { id: 'b', values: [
"none",
"0s",
"ease",
"0s",
"1",
"normal",
"none" ] },
59 { id: 'c', values: [
"anim1",
"10s",
"ease",
"0s",
"1",
"normal",
"none" ] },
60 { id: 'd', values: [
"anim1",
"10s",
"linear",
"0s",
"1",
"normal",
"none" ] },
61 { id: 'e', values: [
"anim1",
"10s",
"linear",
"5s",
"1",
"normal",
"none" ] },
62 { id: 'f', values: [
"anim1",
"10s",
"linear",
"5s",
"3",
"normal",
"none" ] },
63 { id: 'g', values: [
"anim1",
"10s",
"linear",
"5s",
"infinite",
"alternate",
"none" ] },
64 { id: 'h', values: [
"anim1",
"10s",
"linear",
"5s",
"infinite",
"alternate",
"forwards" ] },
65 { id: 'i', values: [
"anim1",
"10s",
"linear",
"0s",
"1",
"normal",
"none" ] },
66 { id: 'j', values: [
"anim1, anim2, anim3",
"10s, 3s, 5s",
"linear, ease, ease",
"0s, 0s, 0s",
"infinite, 1, 1",
"normal, normal, normal",
"backwards, none, both" ] }
71 var resultsString =
"";
72 kExpectedResults.forEach(function(curItem) {
73 var el = document.getElementById(curItem.id);
74 var elStyle = window.getComputedStyle(el);
76 for (var i=
0; i < kProperties.length; i++) {
77 var computedValue = elStyle[kProperties[i]];
78 var expectedValue = curItem.values[i];
79 if (computedValue == expectedValue)
80 resultsString +=
"Testing " + kProperties[i] +
" on " + curItem.id +
": PASS" +
"<br>";
82 resultsString +=
"Testing " + kProperties[i] +
" on " + curItem.id +
" expected <code>" + expectedValue +
"</code> got <code>" + computedValue +
"</code>: FAIL" +
"<br>";
87 var results = document.getElementById('result');
88 results.innerHTML = resultsString;
91 window.addEventListener('load', start, false);
95 <div id=
"a" class=
"box"></div>
96 <div id=
"b" class=
"box"></div>
97 <div id=
"c" class=
"box"></div>
98 <div id=
"d" class=
"box"></div>
99 <div id=
"e" class=
"box"></div>
100 <div id=
"f" class=
"box"></div>
101 <div id=
"g" class=
"box"></div>
102 <div id=
"h" class=
"box"></div>
103 <div id=
"i" class=
"box"></div>
104 <div id=
"j" class=
"box"></div>