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