blob: cfbfaef35ad97f43e3259d5fb924897f5a0c1409 [file] [log] [blame]
<!doctype html><!-- webkit-test-runner [ enableCSSAnimationsAndCSSTransitionsBackedByWebAnimations=true ] -->
<html lang="en">
<head>
<title>Test of -webkit-animation-direction timing functions</title>
<style>
body {
margin: 0;
}
.box {
position: relative;
left: 20px;
top: 10px;
height: 50px;
width: 250px;
margin-bottom: 10px;
-webkit-animation-duration: 2s;
-webkit-animation-timing-function: ease; /* ease is good for testing because it is not symmetric */
-webkit-animation-iteration-count: 4;
}
.move1 {
-webkit-animation-name: move1;
background-color: blue;
color: white;
}
.normal {
-webkit-animation-direction: normal;
}
.alternate {
-webkit-animation-direction: alternate;
}
.reverse {
-webkit-animation-direction: reverse;
}
.alternate-reverse {
-webkit-animation-direction: alternate-reverse;
}
@-webkit-keyframes move1 {
from { left: 0px; }
to { left: 200px; }
}
</style>
<script src="resources/animation-test-helpers.js"></script>
<script>
const expectedValues = [
// [animation-name, time, element-id, property, expected-value, tolerance]
["move1", 0.2, "box1", "left", 18, 10],
["move1", 0.2, "box2", "left", 18, 10],
["move1", 0.2, "box3", "left", 198, 10],
["move1", 0.2, "box4", "left", 198, 10],
["move1", 2.2, "box1", "left", 18, 10],
["move1", 2.2, "box2", "left", 198, 10],
["move1", 2.2, "box3", "left", 198, 10],
["move1", 2.2, "box4", "left", 18, 10],
];
runAnimationTest(expectedValues);
</script>
</head>
<body>
<div id="box1" class="box move1 normal">normal</div>
<div id="box2" class="box move1 alternate">alternate</div>
<div id="box3" class="box move1 reverse">reverse</div>
<div id="box4" class="box move1 alternate-reverse">alternate-reverse</div>
<div id="result"></div>
</div>
</body>
</html>