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