blob: ec3d8ac0e2dea280e3dbd39533871dba38341469 [file] [log] [blame]
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Test of -webkit-animation-direction</title>
<style type="text/css" media="screen">
body {
margin: 0;
}
#box {
position: absolute;
left: 0px;
top: 100px;
height: 100px;
width: 100px;
background-color: red;
margin: 0;
-webkit-animation-duration: 2s;
-webkit-animation-direction: reverse;
-webkit-animation-timing-function: linear;
-webkit-animation-name: "move1";
}
@-webkit-keyframes "move1" {
from { -webkit-transform: translateX(0px); }
to { -webkit-transform: translateX(200px); }
}
#result {
color: white; /* hide from pixel results */
}
</style>
<script src="resources/animation-test-helpers.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
const expectedValues = [
// [time, element-id, property, expected-value, tolerance]
[0.5, "box", "webkitTransform", [1,0,0,1, 150,0], 20],
[1.0, "box", "webkitTransform", [1,0,0,1,100,0], 20],
[2.5, "box", "webkitTransform", [1,0,0,1, 200,0], 20],
];
const callbacks = {
2.5: function() { document.getElementById("box").style.webkitAnimationPlayState = "paused"; }
};
// FIXME: the pause api doesn't understand animation play state
runAnimationTest(expectedValues, callbacks, null, 'do-not-use-pause-api');
</script>
</head>
<body>
<div id="box"></div>
<div id="result"></div>
</div>
</body>
</html>