Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / transitions / start-transform-transition.html
blobfd50957651d8a98a614a585bd1934a88c4f284e9
1 <html>
2 <head>
3 <style>
4 .box {
5 position: relative;
6 width: 100px;
7 height: 100px;
8 background-color: blue;
9 -webkit-transition-property: transform;
10 -webkit-transition-duration: 5s;
11 transform: translate(0, 0);
14 .moved {
15 transform: translateX(300px);
17 </style>
18 <script>
19 if (window.testRunner) {
20 testRunner.dumpAsText();
21 testRunner.waitUntilDone();
24 function test()
26 var t = window.getComputedStyle(document.getElementById('box')).webkitTransform;
27 // grab the x value from the matrix()
28 var lastValueRE = /([\.\d]+),[^,]+\)$/;
29 var xTranslate = lastValueRE.exec(t)[1];
30 var result = (xTranslate > 0) ? 'PASS' : 'FAIL: transition should be running, so x > 0';
31 document.getElementById('result').innerHTML = result;
33 if (window.testRunner)
34 testRunner.notifyDone();
37 function startTest()
39 window.setTimeout(function() {
40 document.getElementById('box').className = 'moved box';
41 window.setTimeout(test, 200);
42 }, 200);
44 </script>
45 </head>
46 <body onload="startTest()">
47 <p>Box should start transition from style change on timer</p>
48 <div id="container">
49 <div id="box" class="box" onclick="this.className='redirected box'">
50 </div>
51 </div>
52 <div id="result">
53 </div>
54 </body>
55 </html>