| <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
| "http://www.w3.org/TR/html4/loose.dtd"> |
| |
| <html lang="en"> |
| <head> |
| <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
| <title>Transition Between Transform Operation Lists Which Match</title> |
| <style type="text/css" media="screen"> |
| #box { |
| height: 100px; |
| width: 100px; |
| background-color: blue; |
| -webkit-transform: translateX(0px) rotate(0deg); |
| -webkit-transition-duration: 2s; |
| -webkit-transition-timing-function: linear; |
| -webkit-transition-property: -webkit-transform; |
| } |
| </style> |
| <script src="transition-test-helpers.js" type="text/javascript" charset="utf-8"></script> |
| <script type="text/javascript" charset="utf-8"> |
| |
| function DegreesToRotation(angle) |
| { |
| return roundNumber(Math.cos(angle * Math.PI / 180), 5); |
| } |
| |
| const expectedValues = [ |
| // [time, element-id, property, expected-value, tolerance] |
| [0.5, "box", "-webkit-transform.0", DegreesToRotation(135), DegreesToRotation(10)], |
| [1.0, "box", "-webkit-transform.0", DegreesToRotation(90), DegreesToRotation(10)], |
| ]; |
| |
| function setupTest() |
| { |
| var box = document.getElementById('box'); |
| box.style.webkitTransform = 'translateX(0px) rotate(540deg)'; |
| } |
| |
| runTransitionTest(expectedValues, setupTest, true); |
| |
| </script> |
| </head> |
| <body> |
| |
| <p> |
| Box should spin 540 degrees because that is the specified rotation and the transform operation lists match, |
| so we should animate each operation separately. |
| </p> |
| <div id="box"> |
| </div> |
| <div id="result"> |
| </div> |
| </body> |
| </html> |