dino@apple.com | 5863503 | 2018-09-12 20:59:33 +0000 | [diff] [blame] | 1 | <!DOCTYPE html><!-- webkit-test-runner [ experimental:WebAnimationsCSSIntegrationEnabled=true ] --> |
mikelawther@chromium.org | b649e39 | 2012-07-27 04:32:08 +0000 | [diff] [blame] | 2 | <style> |
| 3 | #box { |
| 4 | width: 10%; |
| 5 | height: 100px; |
| 6 | background-color: green; |
| 7 | -webkit-transition: all 1s linear; |
| 8 | } |
| 9 | |
| 10 | #box.final { |
| 11 | width: 400px; |
| 12 | height: 90%; |
| 13 | } |
| 14 | </style> |
| 15 | Tests transitions to and from a mix of absolute and percent values |
| 16 | </p> |
| 17 | <div style="width: 500px; height: 500px;"> |
| 18 | <div id="box"></div> |
| 19 | </div> |
| 20 | |
| 21 | <div id="result"> |
| 22 | <script src="resources/transition-test-helpers.js"></script> |
| 23 | <script type="text/javascript"> |
| 24 | |
| 25 | const expectedValues = [ |
| 26 | // [time, element-id, property, expected-value, tolerance] |
| 27 | // The transition takes 1 second, so we compute tolerance to allow |
| 28 | // 10% or 100ms variance, (endValue - startValue) / 10. |
| 29 | [0.5, 'box', 'width', 225, 35], |
| 30 | [0.5, 'box', 'height', 275, 35], |
| 31 | ]; |
| 32 | |
| 33 | function setupTest() |
| 34 | { |
| 35 | var box = document.getElementById('box'); |
| 36 | box.className = 'final'; |
| 37 | } |
| 38 | |
| 39 | runTransitionTest(expectedValues, setupTest, usePauseAPI); |
| 40 | </script> |