| <!DOCTYPE html><!-- webkit-test-runner [ experimental:WebAnimationsCSSIntegrationEnabled=false ] --> |
| |
| <html> |
| <head> |
| <style> |
| #box { |
| height: 100px; |
| width: 100px; |
| margin: 10px; |
| background-color: white; |
| outline-color: black; |
| -webkit-transition-property: padding, margin, outline, background, -webkit-border-radius, -webkit-transform-origin; |
| -webkit-transition-duration: 1s; |
| -webkit-transition-timing-function: linear; |
| -webkit-transform-origin: bottom left; |
| } |
| |
| #box.final { |
| padding: 10px; |
| margin: 40px; |
| outline: 10px solid rgb(255, 0, 255); |
| background-color: blue; |
| -webkit-border-radius: 20px; |
| -webkit-transform-origin: top right; |
| } |
| |
| </style> |
| <script src="resources/transition-test-helpers.js"></script> |
| <script type="text/javascript"> |
| |
| const expectedValues = [ |
| // [time, element-id, property, expected-value, tolerance] |
| // The transition takes 1 second, so we compute tolerance to allow |
| // 10% or 100ms variance, (endValue - startValue) / 10. |
| [0.5, 'box', 'padding-top', 5, 1], |
| [0.5, 'box', 'margin-top', 25, 3], |
| [0.5, 'box', 'outline-color', [128, 0, 128], 26], |
| [0.5, 'box', 'background-color', [128, 128, 255], 26], |
| [0.5, 'box', '-webkit-border-top-right-radius', 10, 2], |
| [0.5, 'box', '-webkit-transform-origin', [50, 50], 10], |
| ]; |
| |
| function setupTest() |
| { |
| var box = document.getElementById('box'); |
| box.className = 'final'; |
| } |
| |
| runTransitionTest(expectedValues, setupTest, usePauseAPI); |
| </script> |
| </head> |
| <body> |
| |
| <p> |
| Tests transitions of the shorthand properties padding, margin, outline, background, -webkit-border-radius. |
| </p> |
| <div id="box"></div> |
| |
| <div id="result"> |
| </div> |
| </body> |
| </html> |