blob: 88133a63827d8f5056a4c64e043a93fa436192df [file] [log] [blame]
<html>
<head>
<title>Start Transform Transition</title>
<style type="text/css" media="screen">
.box {
position: relative;
width: 100px;
height: 100px;
background-color: blue;
-webkit-transition-property: -webkit-transform;
-webkit-transition-duration: 5s;
-webkit-transform: translate(0, 0);
}
.moved {
-webkit-transform: translateX(300px);
}
</style>
<script type="text/javascript" charset="utf-8">
if (window.layoutTestController) {
layoutTestController.dumpAsText();
layoutTestController.waitUntilDone();
}
function test()
{
var t = window.getComputedStyle(document.getElementById('box')).webkitTransform;
// grab the x value from the matrix()
var lastValueRE = /([\.\d]+),[^,]+\)$/;
var xTranslate = lastValueRE.exec(t)[1];
var result = (xTranslate > 0) ? 'PASS' : 'FAIL: transition should be running, so x > 0';
document.getElementById('result').innerHTML = result;
if (window.layoutTestController)
layoutTestController.notifyDone();
}
function startTest()
{
window.setTimeout(function() {
document.getElementById('box').className = 'moved box';
window.setTimeout(test, 200);
}, 200);
}
</script>
</head>
<body onload="startTest()">
<p>Box should start transition from style change on timer</p>
<div id="container">
<div id="box" class="box" onclick="this.className='redirected box'">
</div>
</div>
<div id="result">
</div>
</body>
</html>