| <!DOCTYPE html> | |
| <meta charset="UTF-8"> | |
| <style> | |
| .parent { | |
| top: 30px; | |
| margin-bottom: 40px; | |
| } | |
| .target { | |
| position: relative; | |
| width: 10px; | |
| height: 10px; | |
| background-color: black; | |
| display: inline-block; | |
| top: 10px; | |
| } | |
| .expected { | |
| background-color: green; | |
| margin-right: 10px; | |
| } | |
| </style> | |
| <body> | |
| <script src="resources/interpolation-test.js"></script> | |
| <script> | |
| assertInterpolation({ | |
| property: 'top', | |
| from: neutralKeyframe, | |
| to: '20px', | |
| }, [ | |
| {at: -0.3, is: '7px'}, | |
| {at: 0, is: '10px'}, | |
| {at: 0.5, is: '15px'}, | |
| {at: 1, is: '20px'}, | |
| {at: 1.5, is: '25px'}, | |
| ]); | |
| assertNoInterpolation({ | |
| property: 'top', | |
| from: 'initial', | |
| to: '20px', | |
| }); | |
| assertInterpolation({ | |
| property: 'top', | |
| from: 'inherit', | |
| to: '20px', | |
| }, [ | |
| {at: -0.3, is: '33px'}, | |
| {at: 0, is: '30px'}, | |
| {at: 0.5, is: '25px'}, | |
| {at: 1, is: '20px'}, | |
| {at: 1.5, is: '15px'}, | |
| ]); | |
| assertNoInterpolation({ | |
| property: 'top', | |
| from: 'unset', | |
| to: '20px', | |
| }); | |
| assertInterpolation({ | |
| property: 'top', | |
| from: '-10px', | |
| to: '10px' | |
| }, [ | |
| {at: -0.3, is: '-16px'}, | |
| {at: 0, is: '-10px'}, | |
| {at: 0.5, is: '0px'}, | |
| {at: 1, is: '10px'}, | |
| {at: 1.5, is: '20px'} | |
| ]); | |
| </script> | |
| </body> |