OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <body> |
| 4 <template id="target-template"> |
| 5 <svg width="90" height="90"> |
| 6 <feDiffuseLighting class="target" /> |
| 7 </svg> |
| 8 </template> |
| 9 <script src="../svg-attribute-interpolation/resources/interpolation-test.js"></s
cript> |
| 10 <script> |
| 11 'use strict'; |
| 12 assertAttributeInterpolation({ |
| 13 property: 'kernelUnitLength', |
| 14 underlying: '0', |
| 15 from: '1', |
| 16 fromComposite: 'add', |
| 17 to: '6 11', |
| 18 toComposite: 'add', |
| 19 }, [ |
| 20 {at: -0.4, is: '-1, -3'}, |
| 21 {at: 0, is: '1, 1'}, |
| 22 {at: 0.2, is: '2, 3'}, |
| 23 {at: 0.6, is: '4, 7'}, |
| 24 {at: 1, is: '6, 11'}, |
| 25 {at: 1.4, is: '8, 15'}, |
| 26 ]); |
| 27 |
| 28 assertAttributeInterpolation({ |
| 29 property: 'kernelUnitLength', |
| 30 underlying: '3', |
| 31 from: '1', |
| 32 fromComposite: 'add', |
| 33 to: '6 11', |
| 34 toComposite: 'add', |
| 35 }, [ |
| 36 {at: -0.4, is: '2, 0'}, |
| 37 {at: 0, is: '4, 4'}, |
| 38 {at: 0.2, is: '5, 6'}, |
| 39 {at: 0.6, is: '7, 10'}, |
| 40 {at: 1, is: '9, 14'}, |
| 41 {at: 1.4, is: '11, 18'}, |
| 42 ]); |
| 43 |
| 44 assertAttributeInterpolation({ |
| 45 property: 'kernelUnitLength', |
| 46 underlying: '3', |
| 47 from: '1', |
| 48 fromComposite: 'replace', |
| 49 to: '6 11', |
| 50 toComposite: 'add', |
| 51 }, [ |
| 52 {at: -0.4, is: '-2.2, -4.2'}, |
| 53 {at: 0, is: '1, 1'}, |
| 54 {at: 0.2, is: '2.6, 3.6'}, |
| 55 {at: 0.6, is: '5.8, 8.8'}, |
| 56 {at: 1, is: '9, 14'}, |
| 57 {at: 1.4, is: '12.2, 19.2'}, |
| 58 ]); |
| 59 |
| 60 assertAttributeInterpolation({ |
| 61 property: 'kernelUnitLength', |
| 62 underlying: '3', |
| 63 from: '', |
| 64 fromComposite: 'add', |
| 65 to: '6 11', |
| 66 toComposite: 'replace', |
| 67 }, [ |
| 68 {at: -0.4, is: '1.8, -0.2'}, |
| 69 {at: 0, is: '3, 3'}, |
| 70 {at: 0.2, is: '3.6, 4.6'}, |
| 71 {at: 0.6, is: '4.8, 7.8'}, |
| 72 {at: 1, is: '6, 11'}, |
| 73 {at: 1.4, is: '7.2, 14.2'}, |
| 74 ]); |
| 75 |
| 76 assertAttributeInterpolation({ |
| 77 property: 'kernelUnitLength', |
| 78 underlying: '0', |
| 79 from: '-2 10', |
| 80 fromComposite: 'add', |
| 81 to: '3 10', |
| 82 toComposite: 'add', |
| 83 }, [ |
| 84 {at: -0.4, is: '-4, 10'}, |
| 85 {at: 0, is: '-2, 10'}, |
| 86 {at: 0.2, is: '-1, 10'}, |
| 87 {at: 0.6, is: '1, 10'}, |
| 88 {at: 1, is: '3, 10'}, |
| 89 {at: 1.4, is: '5, 10'}, |
| 90 ]); |
| 91 |
| 92 assertAttributeInterpolation({ |
| 93 property: 'kernelUnitLength', |
| 94 underlying: '3', |
| 95 from: '-2 10', |
| 96 fromComposite: 'add', |
| 97 to: '3 10', |
| 98 toComposite: 'add', |
| 99 }, [ |
| 100 {at: -0.4, is: '-1, 13'}, |
| 101 {at: 0, is: '1, 13'}, |
| 102 {at: 0.2, is: '2, 13'}, |
| 103 {at: 0.6, is: '4, 13'}, |
| 104 {at: 1, is: '6, 13'}, |
| 105 {at: 1.4, is: '8, 13'}, |
| 106 ]); |
| 107 |
| 108 assertAttributeInterpolation({ |
| 109 property: 'kernelUnitLength', |
| 110 underlying: '3', |
| 111 from: '-2 10', |
| 112 fromComposite: 'replace', |
| 113 to: '3 10', |
| 114 toComposite: 'add', |
| 115 }, [ |
| 116 {at: -0.4, is: '-5.2, 8.8'}, |
| 117 {at: 0, is: '-2, 10'}, |
| 118 {at: 0.2, is: '-0.4, 10.6'}, |
| 119 {at: 0.6, is: '2.8, 11.8'}, |
| 120 {at: 1, is: '6, 13'}, |
| 121 {at: 1.4, is: '9.2, 14.2'}, |
| 122 ]); |
| 123 |
| 124 assertAttributeInterpolation({ |
| 125 property: 'kernelUnitLength', |
| 126 underlying: '3', |
| 127 from: '', |
| 128 fromComposite: 'replace', |
| 129 to: '3 10', |
| 130 toComposite: 'replace', |
| 131 }, [ |
| 132 {at: -0.4, is: '-1.2, -4'}, |
| 133 {at: 0, is: '0, 0'}, |
| 134 {at: 0.2, is: '0.6, 2'}, |
| 135 {at: 0.6, is: '1.8, 6'}, |
| 136 {at: 1, is: '3, 10'}, |
| 137 {at: 1.4, is: '4.2, 14'}, |
| 138 ]); |
| 139 </script> |
| 140 </body> |
| 141 </html> |
OLD | NEW |