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