| OLD | NEW |
| 1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" | 1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
| 2 "http://www.w3.org/TR/html4/loose.dtd"> | 2 "http://www.w3.org/TR/html4/loose.dtd"> |
| 3 | 3 |
| 4 <html lang="en"> | 4 <html lang="en"> |
| 5 <head> | 5 <head> |
| 6 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | 6 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
| 7 <style> | 7 <style> |
| 8 #container { | 8 #container { |
| 9 position: relative; | 9 position: relative; |
| 10 width: 400px; | 10 width: 400px; |
| 11 height: 100px; | 11 height: 100px; |
| 12 border: 1px solid black; | 12 border: 1px solid black; |
| 13 } | 13 } |
| 14 | 14 |
| 15 .box { | 15 .box { |
| 16 position: absolute; | 16 position: absolute; |
| 17 width: 100px; | 17 width: 100px; |
| 18 height: 100px; | 18 height: 100px; |
| 19 background-color: green; | 19 background-color: green; |
| 20 } | 20 } |
| 21 | 21 |
| 22 .indicator { | 22 .indicator { |
| 23 left: 10px; | 23 left: 10px; |
| 24 top: 0; | 24 top: 0; |
| 25 background-color: red; | 25 background-color: red; |
| 26 } | 26 } |
| 27 | 27 |
| 28 #container.moved .hardware { | 28 #container.moved .hardware { |
| 29 -webkit-animation: move 300ms linear; | 29 animation: move 300ms linear; |
| 30 } | 30 } |
| 31 | 31 |
| 32 .hardware { | 32 .hardware { |
| 33 -webkit-transform-style: preserve-3d; | 33 transform-style: preserve-3d; |
| 34 transform: translate3d(10px, 0, 0); | 34 transform: translate3d(10px, 0, 0); |
| 35 } | 35 } |
| 36 | 36 |
| 37 @-webkit-keyframes move { | 37 @keyframes move { |
| 38 from { transform: translate3d(10px, 0, 0); } | 38 from { transform: translate3d(10px, 0, 0); } |
| 39 to { transform: translate3d(300px, 0, 0); } | 39 to { transform: translate3d(300px, 0, 0); } |
| 40 } | 40 } |
| 41 </style> | 41 </style> |
| 42 <script type="text/javascript" charset="utf-8"> | 42 <script type="text/javascript" charset="utf-8"> |
| 43 | 43 |
| 44 function testEnded() | 44 function testEnded() |
| 45 { | 45 { |
| 46 if (window.testRunner) | 46 if (window.testRunner) |
| 47 window.setTimeout(function() { testRunner.notifyDone(); }, 0); | 47 window.setTimeout(function() { testRunner.notifyDone(); }, 0); |
| 48 } | 48 } |
| 49 | 49 |
| 50 function startTest() | 50 function startTest() |
| 51 { | 51 { |
| 52 if (window.testRunner) | 52 if (window.testRunner) |
| 53 testRunner.waitUntilDone(); | 53 testRunner.waitUntilDone(); |
| 54 | 54 |
| 55 document.getElementById('tester').addEventListener('webkitAnimationEnd', t
estEnded, false); | 55 document.getElementById('tester').addEventListener('animationend', testEnd
ed, false); |
| 56 document.getElementById('container').className = 'moved'; | 56 document.getElementById('container').className = 'moved'; |
| 57 } | 57 } |
| 58 | 58 |
| 59 window.addEventListener('load', startTest, false); | 59 window.addEventListener('load', startTest, false); |
| 60 </script> | 60 </script> |
| 61 </head> | 61 </head> |
| 62 <body> | 62 <body> |
| 63 | 63 |
| 64 <p>At the end of the test the green box should obscure the red box.</p> | 64 <p>At the end of the test the green box should obscure the red box.</p> |
| 65 <div id="container"> | 65 <div id="container"> |
| 66 <div class="indicator box"></div> | 66 <div class="indicator box"></div> |
| 67 <div id="tester" class="hardware box"></div> | 67 <div id="tester" class="hardware box"></div> |
| 68 </div> | 68 </div> |
| 69 | 69 |
| 70 <div id="result"> | 70 <div id="result"> |
| 71 </div> | 71 </div> |
| 72 | 72 |
| 73 </body> | 73 </body> |
| 74 </html> | 74 </html> |
| OLD | NEW |