OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <body> |
| 4 <template id="target-template"> |
| 5 <svg width="0" height="0"> |
| 6 <text class="target">123</text> |
| 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: 'dx', |
| 14 underlying: '2', |
| 15 from: '-1', |
| 16 fromComposite: 'add', |
| 17 to: '4', |
| 18 toComposite: 'add' |
| 19 }, [ |
| 20 {at: -0.4, is: '-1'}, |
| 21 {at: 0, is: '1'}, |
| 22 {at: 0.2, is: '2'}, |
| 23 {at: 0.6, is: '4'}, |
| 24 {at: 1, is: '6'}, |
| 25 {at: 1.4, is: '8'}, |
| 26 ]); |
| 27 assertAttributeInterpolation({ |
| 28 property: 'dy', |
| 29 underlying: '2 2', |
| 30 from: '-1 -4', |
| 31 fromComposite: 'add', |
| 32 to: '4 -14', |
| 33 toComposite: 'add' |
| 34 }, [ |
| 35 {at: -0.4, is: '-1 2'}, |
| 36 {at: 0, is: '1 -2'}, |
| 37 {at: 0.2, is: '2 -4'}, |
| 38 {at: 0.6, is: '4 -8'}, |
| 39 {at: 1, is: '6 -12'}, |
| 40 {at: 1.4, is: '8 -16'}, |
| 41 ]); |
| 42 |
| 43 assertAttributeInterpolation({ |
| 44 property: 'dx', |
| 45 underlying: '2', |
| 46 from: '1', |
| 47 fromComposite: 'replace', |
| 48 to: '4', |
| 49 toComposite: 'add' |
| 50 }, [ |
| 51 {at: -0.4, is: '-1'}, |
| 52 {at: 0, is: '1'}, |
| 53 {at: 0.2, is: '2'}, |
| 54 {at: 0.6, is: '4'}, |
| 55 {at: 1, is: '6'}, |
| 56 {at: 1.4, is: '8'}, |
| 57 ]); |
| 58 assertAttributeInterpolation({ |
| 59 property: 'dy', |
| 60 underlying: '2 2', |
| 61 from: '1 -2', |
| 62 fromComposite: 'replace', |
| 63 to: '4 -14', |
| 64 toComposite: 'add' |
| 65 }, [ |
| 66 {at: -0.4, is: '-1 2'}, |
| 67 {at: 0, is: '1 -2'}, |
| 68 {at: 0.2, is: '2 -4'}, |
| 69 {at: 0.6, is: '4 -8'}, |
| 70 {at: 1, is: '6 -12'}, |
| 71 {at: 1.4, is: '8 -16'}, |
| 72 ]); |
| 73 |
| 74 assertAttributeInterpolation({ |
| 75 property: 'dx', |
| 76 underlying: '1', |
| 77 from: neutralKeyframe, |
| 78 to: '6', |
| 79 toComposite: 'replace' |
| 80 }, [ |
| 81 {at: -0.4, is: '-1'}, |
| 82 {at: 0, is: '1'}, |
| 83 {at: 0.2, is: '2'}, |
| 84 {at: 0.6, is: '4'}, |
| 85 {at: 1, is: '6'}, |
| 86 {at: 1.4, is: '8'}, |
| 87 ]); |
| 88 assertAttributeInterpolation({ |
| 89 property: 'dy', |
| 90 underlying: '1 -2', |
| 91 from: neutralKeyframe, |
| 92 to: '6 -12', |
| 93 toComposite: 'replace' |
| 94 }, [ |
| 95 {at: -0.4, is: '-1 2'}, |
| 96 {at: 0, is: '1 -2'}, |
| 97 {at: 0.2, is: '2 -4'}, |
| 98 {at: 0.6, is: '4 -8'}, |
| 99 {at: 1, is: '6 -12'}, |
| 100 {at: 1.4, is: '8 -16'}, |
| 101 ]); |
| 102 |
| 103 assertAttributeInterpolation({ |
| 104 property: 'dx', |
| 105 underlying: '1', |
| 106 from: '2 3', |
| 107 fromComposite: 'add', |
| 108 to: '4 5 6', |
| 109 toComposite: 'add' |
| 110 }, [ |
| 111 {at: -0.4, is: '2 3'}, |
| 112 {at: 0, is: '2 3'}, |
| 113 {at: 0.2, is: '2 3'}, |
| 114 {at: 0.6, is: '4 5 6'}, |
| 115 {at: 1, is: '4 5 6'}, |
| 116 {at: 1.4, is: '4 5 6'}, |
| 117 ]); |
| 118 assertAttributeInterpolation({ |
| 119 property: 'dy', |
| 120 underlying: '1 2', |
| 121 from: '3', |
| 122 fromComposite: 'add', |
| 123 to: '4 5 6', |
| 124 toComposite: 'add' |
| 125 }, [ |
| 126 {at: -0.4, is: '3'}, |
| 127 {at: 0, is: '3'}, |
| 128 {at: 0.2, is: '3'}, |
| 129 {at: 0.6, is: '4 5 6'}, |
| 130 {at: 1, is: '4 5 6'}, |
| 131 {at: 1.4, is: '4 5 6'}, |
| 132 ]); |
| 133 </script> |
| 134 </body> |
| 135 </html> |
OLD | NEW |