OLD | NEW |
| (Empty) |
1 <!DOCTYPE html> | |
2 <html> | |
3 <head> | |
4 <script src="../resources/js-test.js"></script> | |
5 <style> | |
6 #base { | |
7 animation-name: anim; | |
8 animation-duration: 5s; | |
9 animation-timing-function: linear; | |
10 animation-delay: 2s; | |
11 animation-iteration-count: infinite; | |
12 animation-direction: alternate; | |
13 animation-play-state: running; | |
14 } | |
15 | |
16 #inherit { | |
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; | |
24 } | |
25 | |
26 #initial { | |
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; | |
34 } | |
35 | |
36 </style> | |
37 </head> | |
38 <body> | |
39 <div style="width:500px;height:500px" id="base"> | |
40 <div id="inherit"></div> | |
41 <div id="initial"></div> | |
42 </div> | |
43 <script> | |
44 description("Test that inherit and initial works on unprefixed animations.") | |
45 | |
46 var testContainer = document.createElement("div"); | |
47 document.body.appendChild(testContainer); | |
48 | |
49 e = document.getElementById('inherit'); | |
50 computedStyle = window.getComputedStyle(e, null); | |
51 | |
52 debug("Testing inherit."); | |
53 shouldBe("computedStyle.animationName", "'anim'"); | |
54 shouldBe("computedStyle.webkitAnimationName", "'anim'"); | |
55 | |
56 shouldBe("computedStyle.animationDuration", "'5s'"); | |
57 shouldBe("computedStyle.webkitAnimationDuration", "'5s'"); | |
58 | |
59 shouldBe("computedStyle.animationTimingFunction", "'linear'"); | |
60 shouldBe("computedStyle.webkitAnimationTimingFunction", "'linear'"); | |
61 | |
62 shouldBe("computedStyle.animationDelay", "'2s'"); | |
63 shouldBe("computedStyle.webkitAnimationDelay", "'2s'"); | |
64 | |
65 shouldBe("computedStyle.animationIterationCount", "'infinite'"); | |
66 shouldBe("computedStyle.webkitAnimationIterationCount", "'infinite'"); | |
67 | |
68 shouldBe("computedStyle.animationDirection", "'alternate'"); | |
69 shouldBe("computedStyle.webkitAnimationDirection", "'alternate'"); | |
70 | |
71 shouldBe("computedStyle.animationPlayState", "'running'"); | |
72 shouldBe("computedStyle.webkitAnimationPlayState", "'running'"); | |
73 | |
74 e = document.getElementById('initial'); | |
75 computedStyle = window.getComputedStyle(e, null); | |
76 debug("Testing initial."); | |
77 | |
78 shouldBe("computedStyle.animationName", "'none'"); | |
79 shouldBe("computedStyle.webkitAnimationName", "'none'"); | |
80 | |
81 shouldBe("computedStyle.animationDuration", "'0s'"); | |
82 shouldBe("computedStyle.webkitAnimationDuration", "'0s'"); | |
83 | |
84 shouldBe("computedStyle.animationTimingFunction", "'ease'"); | |
85 shouldBe("computedStyle.webkitAnimationTimingFunction", "'ease'"); | |
86 | |
87 shouldBe("computedStyle.animationDelay", "'0s'"); | |
88 shouldBe("computedStyle.webkitAnimationDelay", "'0s'"); | |
89 | |
90 shouldBe("computedStyle.animationIterationCount", "'1'"); | |
91 shouldBe("computedStyle.webkitAnimationIterationCount", "'1'"); | |
92 | |
93 shouldBe("computedStyle.animationDirection", "'normal'"); | |
94 shouldBe("computedStyle.webkitAnimationDirection", "'normal'"); | |
95 | |
96 shouldBe("computedStyle.animationPlayState", "'running'"); | |
97 shouldBe("computedStyle.webkitAnimationPlayState", "'running'"); | |
98 | |
99 document.body.removeChild(testContainer); | |
100 </script> | |
101 </body> | |
102 </html> | |
OLD | NEW |