blob: 7247faaa2c0badd4c37af72805c5898c14472aab [file] [log] [blame]
<html>
<head>
<style type="text/css" media="screen">
#test1 {
width: 20px;
height: 20px;
background-color: blue;
position: relative;
-webkit-animation-name: anim1;
-webkit-animation-duration: 10s;
-webkit-animation-fill-mode: backwards;
-webkit-animation-iteration-count: 10;
-webkit-animation-timing-function: linear;
-webkit-animation-direction: normal;
}
#test2 {
width: 20px;
height: 20px;
background-color: blue;
position: relative;
-webkit-animation-name: anim2, anim3;
-webkit-animation-duration: 5s, 2500ms;
-webkit-animation-fill-mode: forwards, both;
-webkit-animation-iteration-count: 10, infinite;
-webkit-animation-timing-function: linear, ease-in-out;
-webkit-animation-direction: normal, alternate;
}
#test3 {
width: 20px;
height: 20px;
background-color: blue;
position: relative;
-webkit-animation-name: anim1, anim2, anim3;
-webkit-animation-duration: 5s;
-webkit-animation-timing-function: step-start, step-end, steps(5, end);
}
@-webkit-keyframes anim1 {
from { left: 10px; }
to { left: 20px; }
}
@-webkit-keyframes anim2 {
from { width: 20px; }
to { width: 25px; }
}
@-webkit-keyframes anim3 {
from { left: 10px; }
to { left: 20px; }
}
</style>
<script src="../resources/js-test-pre.js"></script>
</head>
<body>
<p id="test1"></p>
<p id="test2"></p>
<p id="test3"></p>
<p id="description"></p>
<div id="console"></div>
<script>
description("This tests computed style values from animation properties.");
var test1 = document.getElementById("test1");
var test2 = document.getElementById("test2");
var test1Style = window.getComputedStyle(test1);
var test2Style = window.getComputedStyle(test2);
var test3Style = window.getComputedStyle(test3);
shouldBe("test1Style.webkitAnimationName", "'anim1'");
shouldBe("test2Style.webkitAnimationName", "'anim2, anim3'");
shouldBe("test3Style.webkitAnimationName", "'anim1, anim2, anim3'");
shouldBe("test1Style.webkitAnimationDuration", "'10s'");
shouldBe("test2Style.webkitAnimationDuration", "'5s, 2.5s'");
shouldBe("test1Style.webkitAnimationFillMode", "'backwards'");
shouldBe("test2Style.webkitAnimationFillMode", "'forwards, both'");
shouldBe("test1Style.webkitAnimationIterationCount", "'10'");
shouldBe("test2Style.webkitAnimationIterationCount", "'10, infinite'");
shouldBe("test1Style.webkitAnimationTimingFunction", "'linear'");
shouldBe("test2Style.webkitAnimationTimingFunction", "'linear, ease-in-out'");
shouldBe("test3Style.webkitAnimationTimingFunction", "'steps(1, start), steps(1), steps(5)'");
shouldBe("test1Style.webkitAnimationDirection", "'normal'");
shouldBe("test2Style.webkitAnimationDirection", "'normal, alternate'");
debug("");
</script>
<script src="../resources/js-test-post.js"></script>
</body>
</html>