| <!DOCTYPE> |
| |
| <html lang="en"> |
| <head> |
| <title>background-position and size transitions</title> |
| <style type="text/css" media="screen"> |
| .box { |
| height: 100px; |
| width: 100px; |
| margin: 10px; |
| -webkit-transition-duration: 1s; |
| -webkit-transition-timing-function: linear; |
| } |
| |
| #box { |
| background: url('../fast/backgrounds/repeat/resources/gradient.gif') repeat 0 0; |
| -webkit-transition-property: background-position; |
| } |
| |
| #box.final { |
| background-position: 20px 20px; |
| } |
| |
| #box2 { |
| background: url('../fast/backgrounds/repeat/resources/gradient.gif') repeat 0 0; |
| -webkit-transition-property: -webkit-background-size; |
| -webkit-background-size: 10px 10px; |
| } |
| |
| #box2.final { |
| -webkit-background-size: 30px 30px; |
| } |
| |
| </style> |
| <script src="transition-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', 'background-position', [10, 10], 2], |
| [0.5, 'box2', '-webkit-background-size', [20, 20], 2], |
| ]; |
| |
| function setupTest() |
| { |
| document.getElementById('box').className = 'box final'; |
| document.getElementById('box2').className = 'box final'; |
| } |
| |
| runTransitionTest(expectedValues, setupTest, true); |
| |
| </script> |
| </head> |
| <body> |
| |
| <div id="box" class="box"></div> |
| <div id="box2" class="box"></div> |
| |
| <div id="result"> |
| </div> |
| |
| </body> |
| </html> |