| <html> |
| <head> |
| <style type="text/css"> |
| #box { |
| position: relative; |
| height: 100px; |
| width: 100px; |
| margin: 20px; |
| background-color: red; |
| -webkit-transform: translateZ(0); |
| -webkit-animation: |
| horizontal 2s linear 1 alternate, |
| fade 2s steps(1, end) 1 alternate; |
| } |
| |
| @-webkit-keyframes horizontal { |
| from { -webkit-transform: translateX(0px); } |
| to { -webkit-transform: translateX(200px); } |
| } |
| |
| @-webkit-keyframes fade { |
| from { opacity: 1.0; } |
| to { opacity: 0.0; } |
| } |
| </style> |
| <script src="resources/animation-test-helpers.js" type="text/javascript" charset="utf-8"></script> |
| <script type="text/javascript" charset="utf-8"> |
| const expectedValues = [ |
| // [time, element-id, property, expected-value, tolerance] |
| [0.5, "box", "webkitTransform", [1,0,0,1, 50,0], 20], |
| [1.0, "box", "webkitTransform", [1,0,0,1,100,0], 20], |
| [1.5, "box", "webkitTransform", [1,0,0,1,150,0], 20], |
| [0.5, "box", "opacity", 1.0, 0.15], |
| [0.9, "box", "opacity", 1.0, 0.15], |
| [1.5, "box", "opacity", 1.0, 0.15], |
| ]; |
| |
| // pixel test image has to have 1.0 opacity. |
| var doPixelTest = true; |
| runAnimationTest(expectedValues, null, null, null, doPixelTest); |
| </script> |
| </head> |
| <body> |
| <div id="box"></div> |
| <div id="result"></div> |
| </body> |
| </html> |