OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <meta charset="UTF-8"> |
| 3 <style> |
| 4 .parent { |
| 5 --length: 30px; |
| 6 } |
| 7 .target { |
| 8 --length: 10px; |
| 9 font-size: 20px; |
| 10 } |
| 11 </style> |
| 12 <body> |
| 13 <script src="../interpolation/resources/interpolation-test.js"></script> |
| 14 <script> |
| 15 CSS.registerProperty({ |
| 16 name: '--length', |
| 17 syntax: '<length>', |
| 18 initialValue: '40px', |
| 19 }); |
| 20 |
| 21 assertInterpolation({ |
| 22 property: '--length', |
| 23 from: neutralKeyframe, |
| 24 to: '20px', |
| 25 }, [ |
| 26 {at: -0.3, is: '7px'}, |
| 27 {at: 0, is: '10px'}, |
| 28 {at: 0.5, is: '15px'}, |
| 29 {at: 1, is: '20px'}, |
| 30 {at: 1.5, is: '25px'}, |
| 31 ]); |
| 32 |
| 33 assertInterpolation({ |
| 34 property: '--length', |
| 35 from: 'initial', |
| 36 to: '20px', |
| 37 }, [ |
| 38 {at: -0.3, is: '46px'}, |
| 39 {at: 0, is: '40px'}, |
| 40 {at: 0.5, is: '30px'}, |
| 41 {at: 1, is: '20px'}, |
| 42 {at: 1.5, is: '10px'}, |
| 43 ]); |
| 44 |
| 45 assertInterpolation({ |
| 46 property: '--length', |
| 47 from: 'inherit', |
| 48 to: '20px', |
| 49 }, [ |
| 50 {at: -0.3, is: '33px'}, |
| 51 {at: 0, is: '30px'}, |
| 52 {at: 0.5, is: '25px'}, |
| 53 {at: 1, is: '20px'}, |
| 54 {at: 1.5, is: '15px'}, |
| 55 ]); |
| 56 |
| 57 assertInterpolation({ |
| 58 property: '--length', |
| 59 from: 'unset', |
| 60 to: '20px', |
| 61 }, [ |
| 62 {at: -0.3, is: '46px'}, |
| 63 {at: 0, is: '40px'}, |
| 64 {at: 0.5, is: '30px'}, |
| 65 {at: 1, is: '20px'}, |
| 66 {at: 1.5, is: '10px'}, |
| 67 ]); |
| 68 |
| 69 assertInterpolation({ |
| 70 property: '--length', |
| 71 from: '-10px', |
| 72 to: '10px', |
| 73 }, [ |
| 74 {at: -0.3, is: '-16px'}, |
| 75 {at: 0, is: '-10px'}, |
| 76 {at: 0.5, is: '0px'}, |
| 77 {at: 1, is: '10px'}, |
| 78 {at: 1.5, is: '20px'} |
| 79 ]); |
| 80 |
| 81 assertInterpolation({ |
| 82 property: '--length', |
| 83 from: '10em', |
| 84 to: '20em', |
| 85 }, [ |
| 86 {at: -0.3, is: '140px'}, |
| 87 {at: 0, is: '200px'}, |
| 88 {at: 0.5, is: '300px'}, |
| 89 {at: 1, is: '400px'}, |
| 90 {at: 1.5, is: '500px'} |
| 91 ]); |
| 92 |
| 93 assertInterpolation({ |
| 94 property: '--length', |
| 95 from: '10em', |
| 96 to: '100px', |
| 97 }, [ |
| 98 {at: -0.3, is: '230px'}, |
| 99 {at: 0, is: '200px'}, |
| 100 {at: 0.5, is: '150px'}, |
| 101 {at: 1, is: '100px'}, |
| 102 {at: 1.5, is: '50px'} |
| 103 ]); |
| 104 </script> |
| 105 </body> |
OLD | NEW |