| OLD | NEW |
| (Empty) | |
| 1 <!DOCTYPE html> |
| 2 |
| 3 <html> |
| 4 <head> |
| 5 <style type="text/css"> |
| 6 .box { |
| 7 position: relative; |
| 8 height: 25px; |
| 9 width: 25px; |
| 10 background-color: blue; |
| 11 margin: 10px; |
| 12 } |
| 13 .animation { |
| 14 -webkit-animation-duration: 0.1s; |
| 15 -webkit-animation-name: "animation"; |
| 16 } |
| 17 #animation1 { |
| 18 -webkit-animation-delay: 0.05s; |
| 19 } |
| 20 #animation2 { |
| 21 -webkit-animation-delay: -0.05s; |
| 22 } |
| 23 #animation3 { |
| 24 -webkit-animation-delay: -0.15s; |
| 25 } |
| 26 @-webkit-keyframes "animation" { |
| 27 from { left: 0; } |
| 28 to { left: 500px; } |
| 29 } |
| 30 </style> |
| 31 <script type="text/javascript"> |
| 32 if (window.testRunner) { |
| 33 testRunner.dumpAsText(); |
| 34 testRunner.waitUntilDone(); |
| 35 } |
| 36 function log(text) { |
| 37 var div = document.createElement('div'); |
| 38 div.innerText = text; |
| 39 document.getElementById('log').appendChild(div); |
| 40 } |
| 41 document.addEventListener('webkitAnimationStart', function(event) { |
| 42 log(event.target.id + ': Start event: elapsedTime=' + event.elapsedTime)
; |
| 43 }, false); |
| 44 var count = 0; |
| 45 document.addEventListener('webkitAnimationEnd', function(event) { |
| 46 log(event.target.id + ': End event: elapsedTime=' + event.elapsedTime); |
| 47 switch (++count) { |
| 48 case 1: |
| 49 document.getElementById('animation2').classList.add('animation'); |
| 50 break; |
| 51 case 2: |
| 52 document.getElementById('animation3').classList.add('animation'); |
| 53 break; |
| 54 case 3: |
| 55 if (window.testRunner) |
| 56 testRunner.notifyDone(); |
| 57 } |
| 58 }, false); |
| 59 </script> |
| 60 </head> |
| 61 <body> |
| 62 <p>Tests animation events with a negative delay. |
| 63 <div id="animation1" class="box animation"></div> |
| 64 <div id="animation2" class="box"></div> |
| 65 <div id="animation3" class="box"></div> |
| 66 <div id="log"></div> |
| 67 </body> |
| 68 </html> |
| OLD | NEW |