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