| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 | 2 |
| 3 <html> | 3 <html> |
| 4 <head> | 4 <head> |
| 5 <style> | 5 <style> |
| 6 .container { | 6 .container { |
| 7 height: 240px; | 7 height: 240px; |
| 8 width: 120px; | 8 width: 120px; |
| 9 overflow: hidden; | 9 overflow: hidden; |
| 10 position: relative; | 10 position: relative; |
| 11 z-index: 0; /* create stacking context */ | 11 z-index: 0; /* create stacking context */ |
| 12 border: 1px solid black; | 12 border: 1px solid black; |
| 13 } | 13 } |
| 14 | 14 |
| 15 .box { | 15 .box { |
| 16 position: relative; | 16 position: relative; |
| 17 width: 100px; | 17 width: 100px; |
| 18 height: 100px; | 18 height: 100px; |
| 19 margin: 10px; | 19 margin: 10px; |
| 20 background-color: blue; | 20 background-color: blue; |
| 21 } | 21 } |
| 22 | 22 |
| 23 .animating { | 23 .animating { |
| 24 -webkit-animation: spin 2s infinite linear; | 24 animation: spin 2s infinite linear; |
| 25 } | 25 } |
| 26 | 26 |
| 27 @-webkit-keyframes spin { | 27 @keyframes spin { |
| 28 from { transform: rotate(90deg); } | 28 from { transform: rotate(90deg); } |
| 29 to { transform: rotate(360deg); } | 29 to { transform: rotate(360deg); } |
| 30 } | 30 } |
| 31 </style> | 31 </style> |
| 32 <script> | 32 <script> |
| 33 if (window.testRunner) { | 33 if (window.testRunner) { |
| 34 testRunner.dumpAsText(); | 34 testRunner.dumpAsText(); |
| 35 testRunner.waitUntilDone(); | 35 testRunner.waitUntilDone(); |
| 36 } | 36 } |
| 37 | 37 |
| 38 function runTest() | 38 function runTest() |
| 39 { | 39 { |
| 40 var box = document.getElementById('to-animate'); | 40 var box = document.getElementById('to-animate'); |
| 41 box.addEventListener('webkitAnimationStart', animationStarted, false); | 41 box.addEventListener('animationstart', animationStarted, false); |
| 42 box.className = 'animating box'; | 42 box.className = 'animating box'; |
| 43 } | 43 } |
| 44 | 44 |
| 45 function animationStarted() | 45 function animationStarted() |
| 46 { | 46 { |
| 47 if (window.testRunner) { | 47 if (window.testRunner) { |
| 48 var layerText = window.internals.layerTreeAsText(document); | 48 var layerText = window.internals.layerTreeAsText(document); |
| 49 // The animation can progress before the start event is handled, so remo
ve the | 49 // The animation can progress before the start event is handled, so remo
ve the |
| 50 // effects as they can vary. | 50 // effects as they can vary. |
| 51 layerText = layerText.replace(/\[.*,.*,.*,.*\]/g, '[...]'); | 51 layerText = layerText.replace(/\[.*,.*,.*,.*\]/g, '[...]'); |
| 52 document.getElementById('layers').innerText = layerText; | 52 document.getElementById('layers').innerText = layerText; |
| 53 testRunner.notifyDone(); | 53 testRunner.notifyDone(); |
| 54 } | 54 } |
| 55 } | 55 } |
| 56 window.addEventListener('load', runTest, false); | 56 window.addEventListener('load', runTest, false); |
| 57 </script> | 57 </script> |
| 58 </head> | 58 </head> |
| 59 <body> | 59 <body> |
| 60 <div class="container"> | 60 <div class="container"> |
| 61 <div id="to-animate" class="box"></div> | 61 <div id="to-animate" class="box"></div> |
| 62 <!-- This div will get a layer --> | 62 <!-- This div will get a layer --> |
| 63 <div class="box"></div> | 63 <div class="box"></div> |
| 64 </div> | 64 </div> |
| 65 <!-- This div should not get a layer --> | 65 <!-- This div should not get a layer --> |
| 66 <div class="box"></div> | 66 <div class="box"></div> |
| 67 <pre id="layers">Layer tree goes here in DRT</pre> | 67 <pre id="layers">Layer tree goes here in DRT</pre> |
| 68 </body> | 68 </body> |
| 69 </html> | 69 </html> |
| OLD | NEW |