Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 | |
| 3 <html> | |
| 4 <head> | |
| 5 <style> | |
| 6 #target { | |
| 7 position: relative; | |
| 8 background-color: #933; | |
| 9 width: 50px; | |
| 10 height: 50px; | |
| 11 top: 0px; | |
| 12 left: 0px; | |
| 13 } | |
| 14 #target.transition-top { | |
| 15 top: 400px; | |
| 16 -webkit-transition: top 100ms linear; | |
| 17 transition: top 100ms linear; | |
| 18 } | |
| 19 #target.transition-left { | |
| 20 left: 400px; | |
| 21 -webkit-transition: left 100ms linear; | |
| 22 transition: left 100ms linear; | |
| 23 } | |
| 24 </style> | |
| 25 <script> | |
| 26 if (window.testRunner) { | |
| 27 testRunner.dumpAsText(); | |
| 28 testRunner.waitUntilDone(); | |
| 29 } | |
| 30 | |
| 31 function isEqual(actual, desired, tolerance) | |
| 32 { | |
| 33 var diff = Math.abs(actual - desired); | |
| 34 return diff < tolerance; | |
| 35 } | |
| 36 | |
| 37 function cancelTransition() | |
| 38 { | |
| 39 document.getElementById("target").classList.remove('transition-top') ; | |
| 40 } | |
| 41 | |
| 42 function startNewTransition() | |
| 43 { | |
| 44 document.getElementById("target").classList.add('transition-left'); | |
| 45 setTimeout(check, 50); | |
| 46 } | |
| 47 | |
| 48 function check() | |
| 49 { | |
| 50 var left = parseFloat(window.getComputedStyle(document.getElementByI d('target')).left); | |
| 51 if (isEqual(left, 200, 50)) | |
| 52 var result = "<span style='color:green'>PASS</span>"; | |
| 53 else | |
| 54 var result = "<span style='color:red'>FAIL(was: " + left + ", ex pected: 150)</span>"; | |
|
Timothy Loh
2013/10/30 03:55:07
expected: 200?
Steve Block
2013/11/01 03:04:59
Done.
| |
| 55 document.getElementById('result').innerHTML = result; | |
| 56 if (window.testRunner) | |
| 57 testRunner.notifyDone(); | |
| 58 } | |
| 59 | |
| 60 function start() | |
| 61 { | |
| 62 document.getElementById("target").classList.add('transition-top'); | |
| 63 setTimeout("cancelTransition()", 50); | |
| 64 setTimeout("startNewTransition()", 100); | |
| 65 } | |
| 66 </script> | |
| 67 </head> | |
| 68 <body onload="start()"> | |
| 69 <p> | |
| 70 Tests that having stopped a transition before it completes, a subsequent | |
| 71 transition starts correctly. | |
| 72 </p> | |
| 73 <div id="target"></div> | |
| 74 <div id="result"></div> | |
| 75 </body> | |
| 76 </html> | |
| OLD | NEW |