blob: 0a929ef8bcdb29ea9affd99ad026c02a246a85d4 [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Transition/Animation Test #1</title>
<style type="text/css" media="screen">
#box {
position: absolute;
left: 0;
top: 100px;
height: 100px;
width: 100px;
background-color: blue;
-webkit-animation-duration: 0.5s;
-webkit-animation-timing-function: linear;
-webkit-animation-name: "anim";
-webkit-transition-property: -webkit-transform;
-webkit-transition-duration: 10s;
}
@-webkit-keyframes "anim" {
from { -webkit-transform: translateX(200px); }
to { -webkit-transform: translateX(300px); }
}
</style>
<script type="text/javascript" charset="utf-8">
if (window.layoutTestController) {
layoutTestController.dumpAsText();
layoutTestController.waitUntilDone();
}
result = "PASS";
const defaultTolerance = 0.2;
function isEqual(actual, desired, tolerance)
{
if (tolerance == undefined || tolerance == 0)
tolerance = defaultTolerance;
var diff = Math.abs(actual - desired);
return diff < tolerance;
}
function snapshot(which)
{
var m = window.getComputedStyle(document.getElementById('box')).webkitTransform;
if (m != "none")
result = "FAIL(was:"+m+", expected:none)";
}
function start()
{
setTimeout("snapshot()", 550);
window.setTimeout(function() {
document.getElementById('result').innerHTML = result;
if (window.layoutTestController)
layoutTestController.notifyDone();
}, 600);
}
document.addEventListener('webkitAnimationStart', start, false);
</script>
</head>
<body>
This test has a transition and animation on the same property (-webkit-transform). But the transition is never triggered,
so nothing should be moving when the animation finishes.
<div id="box">
</div>
<div id="result">
</div>
</body>
</html>