Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / animations / animation-shorthand.html
blob805c835fbafad9b81c6e28f9c65affe5d8b9612a
1 <html>
2 <head>
3 <title>Test animation shorthand property</title>
4 <style type="text/css" media="screen">
5 .box {
6 height: 10px;
7 width: 10px;
8 background-color: blue;
10 #a {
12 #b {
13 -webkit-animation: none;
15 #c {
16 -webkit-animation: anim1 10s;
18 #d {
19 -webkit-animation: anim1 10s linear;
21 #e {
22 -webkit-animation: anim1 10s linear 5s;
24 #f {
25 -webkit-animation: anim1 10s linear 5s 3;
27 #g {
28 -webkit-animation: anim1 10s linear 5s infinite alternate;
30 #h {
31 -webkit-animation: anim1 10s linear 5s infinite alternate forwards;
33 #i {
34 -webkit-animation: anim1 10s linear normal none;
36 #j {
37 -webkit-animation: anim1 10s linear infinite backwards, anim2 3s none, anim3 5s both;
40 @-webkit-keyframes anim1 { }
41 @-webkit-keyframes anim2 { }
42 </style>
43 <script type="text/javascript" charset="utf-8">
44 if (window.testRunner)
45 testRunner.dumpAsText();
47 const kProperties = [
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" ] }
69 function start()
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>";
81 else
82 resultsString += "Testing " + kProperties[i] + " on " + curItem.id + " expected <code>" + expectedValue + "</code> got <code>" + computedValue + "</code>: FAIL" + "<br>";
85 });
87 var results = document.getElementById('result');
88 results.innerHTML = resultsString;
91 window.addEventListener('load', start, false);
92 </script>
93 </head>
94 <body>
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>
105 <div id="result">
106 </div>
107 </body>
108 </html>