| <!DOCTYPE html> |
| |
| <html> |
| <head> |
| <style type="text/css" media="screen"> |
| .box { |
| position: absolute; |
| height: 100px; |
| width: 100px; |
| left: 0px; |
| background-color: blue; |
| } |
| |
| .box.animating { |
| -webkit-animation: move 1s linear; |
| left: 400px; |
| } |
| |
| @-webkit-keyframes move { |
| from { |
| } |
| to { |
| left: 500px; |
| } |
| } |
| |
| #result { |
| margin-top: 130px; |
| } |
| </style> |
| <script src="resources/animation-test-helpers.js" type="text/javascript" charset="utf-8"></script> |
| <script type="text/javascript" charset="utf-8"> |
| |
| if (window.layoutTestController) |
| layoutTestController.waitUntilDone(); |
| |
| const expectedValues = [ |
| // [animation-name, time, element-id, property, expected-value, tolerance] |
| ["move", 0.5, "test", "left", 450, 8], |
| ]; |
| |
| function setupTest() |
| { |
| document.getElementById('test').className = 'animating box'; |
| runAnimationTest(expectedValues); |
| } |
| |
| window.addEventListener('load', function() { |
| window.setTimeout(setupTest, 0); |
| }, false); |
| |
| </script> |
| </head> |
| <body> |
| <p>Box should animate from left of 400px to 500px.</p> |
| <div id="test" class="box"></div> |
| <div id="result"></div> |
| </body> |
| </html> |