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 letter-spacing: 2px; |
| 6 } |
4 .target { | 7 .target { |
5 display: inline-block; | 8 font: 10px sans-serif; |
6 font: 100px sans-serif; | 9 font-weight: bold; |
| 10 letter-spacing: 30px; |
7 } | 11 } |
8 .expected { | 12 .expected { |
9 color: green; | 13 color: green; |
10 margin-right: 30px; | 14 margin-right: 30px; |
11 } | 15 } |
12 </style> | 16 </style> |
13 <body> | 17 <body> |
14 <template id="target-template">TT</template> | 18 <template id="target-template">TT</template> |
15 <script src="resources/interpolation-test.js"></script> | 19 <script src="resources/interpolation-test.js"></script> |
16 <script> | 20 <script> |
17 assertInterpolation({ | 21 assertInterpolation({ |
18 property: 'letter-spacing', | 22 property: 'letter-spacing', |
| 23 from: '', |
| 24 to: '20px', |
| 25 }, [ |
| 26 {at: -0.3, is: '33px'}, |
| 27 {at: 0, is: '30px'}, |
| 28 {at: 0.3, is: '27px'}, |
| 29 {at: 0.6, is: '24px'}, |
| 30 {at: 1, is: '20px'}, |
| 31 {at: 1.5, is: '15px'}, |
| 32 ]); |
| 33 |
| 34 assertInterpolation({ |
| 35 property: 'letter-spacing', |
| 36 from: 'initial', |
| 37 to: '20px', |
| 38 }, [ |
| 39 {at: -0.3, is: '-6px'}, |
| 40 {at: 0, is: 'normal'}, |
| 41 {at: 0.3, is: '6px'}, |
| 42 {at: 0.6, is: '12px'}, |
| 43 {at: 1, is: '20px'}, |
| 44 {at: 1.5, is: '30px'}, |
| 45 ]); |
| 46 |
| 47 assertInterpolation({ |
| 48 property: 'letter-spacing', |
| 49 from: 'inherit', |
| 50 to: '20px', |
| 51 }, [ |
| 52 {at: -0.3, is: '-3.4px'}, |
| 53 {at: 0, is: '2px'}, |
| 54 {at: 0.3, is: '7.4px'}, |
| 55 {at: 0.6, is: '12.8px'}, |
| 56 {at: 1, is: '20px'}, |
| 57 {at: 1.5, is: '29px'}, |
| 58 ]); |
| 59 |
| 60 assertInterpolation({ |
| 61 property: 'letter-spacing', |
| 62 from: 'unset', |
| 63 to: '20px', |
| 64 }, [ |
| 65 {at: -0.3, is: '-3.4px'}, |
| 66 {at: 0, is: '2px'}, |
| 67 {at: 0.3, is: '7.4px'}, |
| 68 {at: 0.6, is: '12.8px'}, |
| 69 {at: 1, is: '20px'}, |
| 70 {at: 1.5, is: '29px'}, |
| 71 ]); |
| 72 |
| 73 assertInterpolation({ |
| 74 property: 'letter-spacing', |
19 from: '-10px', | 75 from: '-10px', |
20 to: '10px' | 76 to: '10px', |
21 }, [ | 77 }, [ |
22 {at: -0.3, is: '-16px'}, | 78 {at: -0.3, is: '-16px'}, |
23 {at: 0, is: '-10px'}, | 79 {at: 0, is: '-10px'}, |
24 {at: 0.3, is: '-4px'}, | 80 {at: 0.3, is: '-4px'}, |
25 {at: 0.6, is: '2px'}, | 81 {at: 0.6, is: '2px'}, |
26 {at: 1, is: '10px'}, | 82 {at: 1, is: '10px'}, |
27 {at: 1.5, is: '20px'}, | 83 {at: 1.5, is: '20px'}, |
28 ]); | 84 ]); |
| 85 |
29 assertInterpolation({ | 86 assertInterpolation({ |
30 property: 'letter-spacing', | 87 property: 'letter-spacing', |
31 from: 'normal', | 88 from: 'normal', |
32 to: '10px' | 89 to: '10px', |
33 }, [ | 90 }, [ |
34 {at: -0.3, is: '-3px'}, | 91 {at: -0.3, is: '-3px'}, |
35 {at: 0, is: '0px'}, | 92 {at: 0, is: 'normal'}, |
36 {at: 0.3, is: '3px'}, | 93 {at: 0.3, is: '3px'}, |
37 {at: 0.6, is: '6px'}, | 94 {at: 0.6, is: '6px'}, |
38 {at: 1, is: '10px'}, | 95 {at: 1, is: '10px'}, |
39 {at: 1.5, is: '15px'}, | 96 {at: 1.5, is: '15px'}, |
40 ]); | 97 ]); |
41 </script> | 98 </script> |
42 </body> | 99 </body> |
OLD | NEW |