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