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