| <html> |
| <head> |
| <style> |
| .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> |
| if (window.testRunner) { |
| testRunner.dumpAsText(); |
| testRunner.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.testRunner) |
| testRunner.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> |