| 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 stroke-width: 30px; |
| 6 } |
| 4 .target { | 7 .target { |
| 8 display: inline-block; |
| 5 stroke: black; | 9 stroke: black; |
| 6 fill: white; | 10 fill: none; |
| 7 stroke-width: 5px; | 11 stroke-width: 10px; |
| 8 } | 12 } |
| 9 .expected { | 13 .expected { |
| 10 stroke: green; | 14 stroke: green; |
| 11 } | 15 } |
| 12 </style> | 16 </style> |
| 13 <body> | 17 <body> |
| 14 <template id="target-template"> | 18 <template id="target-template"> |
| 15 <svg width="70" height="70"> | 19 <svg width="100" height="100"> |
| 16 <rect x="10" y="10" width="50" height="50"/> | 20 <rect x="0" y="0" width="100" height="100"/> |
| 17 </svg> | 21 </svg> |
| 18 </template> | 22 </template> |
| 19 <script src="resources/interpolation-test.js"></script> | 23 <script src="resources/interpolation-test.js"></script> |
| 20 <script> | 24 <script> |
| 21 assertInterpolation({ | 25 assertInterpolation({ |
| 22 property: 'stroke-width', | 26 property: 'stroke-width', |
| 27 from: '', |
| 28 to: '20px', |
| 29 }, [ |
| 30 {at: -0.3, is: '7px'}, |
| 31 {at: 0, is: '10px'}, |
| 32 {at: 0.3, is: '13px'}, |
| 33 {at: 0.6, is: '16px'}, |
| 34 {at: 1, is: '20px'}, |
| 35 {at: 1.5, is: '25px'}, |
| 36 ]); |
| 37 |
| 38 assertInterpolation({ |
| 39 property: 'stroke-width', |
| 40 from: 'initial', |
| 41 to: '20px', |
| 42 }, [ |
| 43 {at: -0.3, is: '0px'}, |
| 44 {at: 0, is: '1px'}, |
| 45 {at: 0.3, is: '6.7px'}, |
| 46 {at: 0.6, is: '12.4px'}, |
| 47 {at: 1, is: '20px'}, |
| 48 {at: 1.5, is: '29.5px'}, |
| 49 ]); |
| 50 |
| 51 assertInterpolation({ |
| 52 property: 'stroke-width', |
| 53 from: 'inherit', |
| 54 to: '20px', |
| 55 }, [ |
| 56 {at: -0.3, is: '33px'}, |
| 57 {at: 0, is: '30px'}, |
| 58 {at: 0.3, is: '27px'}, |
| 59 {at: 0.6, is: '24px'}, |
| 60 {at: 1, is: '20px'}, |
| 61 {at: 1.5, is: '15px'}, |
| 62 ]); |
| 63 |
| 64 assertInterpolation({ |
| 65 property: 'stroke-width', |
| 66 from: 'unset', |
| 67 to: '20px', |
| 68 }, [ |
| 69 {at: -0.3, is: '33px'}, |
| 70 {at: 0, is: '30px'}, |
| 71 {at: 0.3, is: '27px'}, |
| 72 {at: 0.6, is: '24px'}, |
| 73 {at: 1, is: '20px'}, |
| 74 {at: 1.5, is: '15px'}, |
| 75 ]); |
| 76 |
| 77 assertInterpolation({ |
| 78 property: 'stroke-width', |
| 23 from: '0px', | 79 from: '0px', |
| 24 to: '20px' | 80 to: '20px' |
| 25 }, [ | 81 }, [ |
| 26 {at: -0.3, is: '0px'}, // SVG stroke-width can't be negative. | 82 {at: -0.3, is: '0px'}, // SVG stroke-width can't be negative. |
| 27 {at: 0, is: '0px'}, | 83 {at: 0, is: '0px'}, |
| 28 {at: 0.3, is: '6px'}, | 84 {at: 0.3, is: '6px'}, |
| 29 {at: 0.6, is: '12px'}, | 85 {at: 0.6, is: '12px'}, |
| 30 {at: 1, is: '20px'}, | 86 {at: 1, is: '20px'}, |
| 31 {at: 1.5, is: '30px'}, | 87 {at: 1.5, is: '30px'}, |
| 32 ]); | 88 ]); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 }, [ | 129 }, [ |
| 74 {at: -0.3, is: '199px'}, | 130 {at: -0.3, is: '199px'}, |
| 75 {at: 0, is: '10em'}, | 131 {at: 0, is: '10em'}, |
| 76 {at: 0.3, is: '121px'}, | 132 {at: 0.3, is: '121px'}, |
| 77 {at: 0.6, is: '82px'}, | 133 {at: 0.6, is: '82px'}, |
| 78 {at: 1, is: '30px'}, | 134 {at: 1, is: '30px'}, |
| 79 {at: 1.5, is: '0px'}, | 135 {at: 1.5, is: '0px'}, |
| 80 ]); | 136 ]); |
| 81 </script> | 137 </script> |
| 82 </body> | 138 </body> |
| OLD | NEW |