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