76 lines
2.1 KiB
HTML
76 lines
2.1 KiB
HTML
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<title>Test of -webkit-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;
|
|
-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 { -webkit-transform: translateX(0px); }
|
|
to { -webkit-transform: translateX(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", "webkitTransform", [1,0,0,1, 18, 0], 10],
|
|
["move1", 0.2, "box2", "webkitTransform", [1,0,0,1, 18, 0], 10],
|
|
["move1", 0.2, "box3", "webkitTransform", [1,0,0,1, 198, 0], 10],
|
|
["move1", 0.2, "box4", "webkitTransform", [1,0,0,1, 198, 0], 10],
|
|
["move1", 2.2, "box1", "webkitTransform", [1,0,0,1, 18, 0], 10],
|
|
["move1", 2.2, "box2", "webkitTransform", [1,0,0,1, 198, 0], 10],
|
|
["move1", 2.2, "box3", "webkitTransform", [1,0,0,1, 198, 0], 10],
|
|
["move1", 2.2, "box4", "webkitTransform", [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>
|