4 <script src=
"../resources/js-test.js"></script>
8 animation-duration:
5s;
9 animation-timing-function: linear;
11 animation-iteration-count: infinite;
12 animation-direction: alternate;
13 animation-play-state: running;
17 animation-name: inherit;
18 animation-duration: inherit;
19 animation-timing-function: inherit;
20 animation-delay: inherit;
21 animation-iteration-count: inherit;
22 animation-direction: inherit;
23 animation-play-state: inherit;
27 animation-name: initial;
28 animation-duration: initial;
29 animation-timing-function: initial;
30 animation-delay: initial;
31 animation-iteration-count: initial;
32 animation-direction: initial;
33 animation-play-state: initial;
39 <div style=
"width:500px;height:500px" id=
"base">
40 <div id=
"inherit"></div>
41 <div id=
"initial"></div>
44 description("Test that inherit and initial works on unprefixed animations.")
46 var testContainer
= document
.createElement("div");
47 document
.body
.appendChild(testContainer
);
49 e
= document
.getElementById('inherit');
50 computedStyle
= window
.getComputedStyle(e
, null);
52 debug("Testing inherit.");
53 shouldBe("computedStyle.animationName", "'anim'");
54 shouldBe("computedStyle.webkitAnimationName", "'anim'");
56 shouldBe("computedStyle.animationDuration", "'5s'");
57 shouldBe("computedStyle.webkitAnimationDuration", "'5s'");
59 shouldBe("computedStyle.animationTimingFunction", "'linear'");
60 shouldBe("computedStyle.webkitAnimationTimingFunction", "'linear'");
62 shouldBe("computedStyle.animationDelay", "'2s'");
63 shouldBe("computedStyle.webkitAnimationDelay", "'2s'");
65 shouldBe("computedStyle.animationIterationCount", "'infinite'");
66 shouldBe("computedStyle.webkitAnimationIterationCount", "'infinite'");
68 shouldBe("computedStyle.animationDirection", "'alternate'");
69 shouldBe("computedStyle.webkitAnimationDirection", "'alternate'");
71 shouldBe("computedStyle.animationPlayState", "'running'");
72 shouldBe("computedStyle.webkitAnimationPlayState", "'running'");
74 e
= document
.getElementById('initial');
75 computedStyle
= window
.getComputedStyle(e
, null);
76 debug("Testing initial.");
78 shouldBe("computedStyle.animationName", "'none'");
79 shouldBe("computedStyle.webkitAnimationName", "'none'");
81 shouldBe("computedStyle.animationDuration", "'0s'");
82 shouldBe("computedStyle.webkitAnimationDuration", "'0s'");
84 shouldBe("computedStyle.animationTimingFunction", "'ease'");
85 shouldBe("computedStyle.webkitAnimationTimingFunction", "'ease'");
87 shouldBe("computedStyle.animationDelay", "'0s'");
88 shouldBe("computedStyle.webkitAnimationDelay", "'0s'");
90 shouldBe("computedStyle.animationIterationCount", "'1'");
91 shouldBe("computedStyle.webkitAnimationIterationCount", "'1'");
93 shouldBe("computedStyle.animationDirection", "'normal'");
94 shouldBe("computedStyle.webkitAnimationDirection", "'normal'");
96 shouldBe("computedStyle.animationPlayState", "'running'");
97 shouldBe("computedStyle.webkitAnimationPlayState", "'running'");
99 document
.body
.removeChild(testContainer
);