| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <meta charset="UTF-8"> | 2 <meta charset="UTF-8"> |
| 3 <style> | 3 <style> |
| 4 .parent { |
| 5 top: 30px; |
| 6 margin-bottom: 40px; |
| 7 } |
| 4 .target { | 8 .target { |
| 5 position: relative; | 9 position: relative; |
| 6 width: 100px; | 10 width: 10px; |
| 7 height: 100px; | 11 height: 10px; |
| 8 background-color: black; | 12 background-color: black; |
| 9 display: inline-block; | 13 display: inline-block; |
| 10 margin: 20px 0px 20px 0px; | 14 top: 10px; |
| 11 } | 15 } |
| 12 .expected { | 16 .expected { |
| 13 background-color: green; | 17 background-color: green; |
| 18 margin-right: 10px; |
| 14 } | 19 } |
| 15 </style> | 20 </style> |
| 16 <body> | 21 <body> |
| 17 <script src="resources/interpolation-test.js"></script> | 22 <script src="resources/interpolation-test.js"></script> |
| 18 <script> | 23 <script> |
| 19 assertInterpolation({ | 24 assertInterpolation({ |
| 20 property: 'top', | 25 property: 'top', |
| 26 from: '', |
| 27 to: '20px', |
| 28 }, [ |
| 29 {at: -0.3, is: '7px'}, |
| 30 {at: 0, is: '10px'}, |
| 31 {at: 0.5, is: '15px'}, |
| 32 {at: 1, is: '20px'}, |
| 33 {at: 1.5, is: '25px'}, |
| 34 ]); |
| 35 |
| 36 assertNoInterpolation({ |
| 37 property: 'top', |
| 38 from: 'initial', |
| 39 to: '20px', |
| 40 }); |
| 41 |
| 42 assertInterpolation({ |
| 43 property: 'top', |
| 44 from: 'inherit', |
| 45 to: '20px', |
| 46 }, [ |
| 47 {at: -0.3, is: '33px'}, |
| 48 {at: 0, is: '30px'}, |
| 49 {at: 0.5, is: '25px'}, |
| 50 {at: 1, is: '20px'}, |
| 51 {at: 1.5, is: '15px'}, |
| 52 ]); |
| 53 |
| 54 assertNoInterpolation({ |
| 55 property: 'top', |
| 56 from: 'unset', |
| 57 to: '20px', |
| 58 }); |
| 59 |
| 60 assertInterpolation({ |
| 61 property: 'top', |
| 21 from: '-10px', | 62 from: '-10px', |
| 22 to: '10px' | 63 to: '10px' |
| 23 }, [ | 64 }, [ |
| 24 {at: -0.3, is: '-16px'}, | 65 {at: -0.3, is: '-16px'}, |
| 25 {at: 0, is: '-10px'}, | 66 {at: 0, is: '-10px'}, |
| 26 {at: 0.5, is: '0px'}, | 67 {at: 0.5, is: '0px'}, |
| 27 {at: 1, is: '10px'}, | 68 {at: 1, is: '10px'}, |
| 28 {at: 1.5, is: '20px'} | 69 {at: 1.5, is: '20px'} |
| 29 ]); | 70 ]); |
| 30 </script> | 71 </script> |
| 31 </body> | 72 </body> |
| OLD | NEW |