| <!DOCTYPE html><!-- webkit-test-runner [ enableCSSAnimationsAndCSSTransitionsBackedByWebAnimations=true ] --> |
| <html> |
| <head> |
| <style> |
| .square { |
| position: absolute; |
| background: blue; |
| width: 20px; |
| height: 20px; |
| -webkit-transition-timing-function: linear; |
| } |
| |
| .translated { |
| -webkit-transform: translateX(600px); |
| } |
| |
| #square1 { |
| top: 20px; |
| left: 0px; |
| -webkit-transition-property: left; |
| -webkit-transition-duration: 2s; |
| -webkit-transition-delay: -1s; |
| } |
| |
| #square1.moved { |
| left: 600px; |
| } |
| |
| #square2 { |
| top: 60px; |
| left: 0px; |
| -webkit-transition-property: left; |
| -webkit-transition-duration: 2s; |
| } |
| |
| #square2.moved { |
| left: 600px; |
| } |
| |
| #square3 { |
| top: 100px; |
| left: 0px; |
| -webkit-transition-property: -webkit-transform; |
| -webkit-transition-duration: 2s; |
| -webkit-transition-delay: -1s; |
| } |
| |
| #square4 { |
| top: 140px; |
| left: 0px; |
| -webkit-transition-property: -webkit-transform; |
| -webkit-transition-duration: 2s; |
| } |
| </style> |
| |
| <script src="resources/transition-test-helpers.js"></script> |
| |
| <script> |
| // The delay of square1 is negative so square1 should be in ahead of square2. |
| const expectedValues = [ |
| // [time, element-id, property, expected-value, tolerance] |
| [0, "square1", "left", 300, 15], |
| [0, "square2", "left", 0, 15], |
| [0.5, "square1", "left", 450, 15], |
| [0.5, "square2", "left", 150, 15], |
| [0, "square3", "-webkit-transform.4", 300, 20], |
| [0, "square4", "-webkit-transform.4", 0, 20], |
| [0.5, "square3", "-webkit-transform.4", 450, 20], |
| [0.5, "square4", "-webkit-transform.4", 150, 20], |
| ]; |
| |
| function setupTest() |
| { |
| document.getElementById('square1').className = 'moved square'; |
| document.getElementById('square2').className = 'moved square'; |
| document.getElementById('square3').className = 'translated square'; |
| document.getElementById('square4').className = 'translated square'; |
| } |
| |
| runTransitionTest(expectedValues, setupTest, usePauseAPI); |
| </script> |
| </head> |
| |
| <body> |
| |
| <div class="square" id="square1"></div> |
| <div class="square" id="square2"></div> |
| <div class="square" id="square3"></div> |
| <div class="square" id="square4"></div> |
| |
| <div id="result"> |
| </div> |
| |
| </body> |
| </html> |