OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <body> |
| 4 <template id="target-template"> |
| 5 <svg width="90" height="90"> |
| 6 <text> |
| 7 <tspan class="target"> |
| 8 abcd |
| 9 </tspan> |
| 10 </text> |
| 11 </svg> |
| 12 </template> |
| 13 <script src="../svg-attribute-interpolation/resources/interpolation-test.js"></s
cript> |
| 14 <script> |
| 15 'use strict'; |
| 16 assertAttributeInterpolation({ |
| 17 property: 'rotate', |
| 18 underlying: '10, 20', |
| 19 fromComposite: 'add', |
| 20 from: '30, 40', |
| 21 toComposite: 'add', |
| 22 to: '50, -10' |
| 23 }, [ |
| 24 {at: -0.4, is: '32, 80'}, |
| 25 {at: 0, is: '40, 60'}, |
| 26 {at: 0.2, is: '44, 50'}, |
| 27 {at: 0.6, is: '52, 30'}, |
| 28 {at: 1.0, is: '60, 10'}, |
| 29 {at: 1.4, is: '68, -10'}, |
| 30 ]); |
| 31 |
| 32 assertAttributeInterpolation({ |
| 33 property: 'rotate', |
| 34 underlying: '10', |
| 35 fromComposite: 'add', |
| 36 from: '20, 30', |
| 37 toComposite: 'add', |
| 38 to: '50, 40' |
| 39 }, [ |
| 40 {at: -0.4, is: '18, 26'}, |
| 41 {at: 0, is: '30, 30'}, |
| 42 {at: 0.2, is: '36, 32'}, |
| 43 {at: 0.6, is: '48, 36'}, |
| 44 {at: 1.0, is: '60, 40'}, |
| 45 {at: 1.4, is: '72, 44'}, |
| 46 ]); |
| 47 |
| 48 assertAttributeInterpolation({ |
| 49 property: 'rotate', |
| 50 underlying: '10, 20', |
| 51 fromComposite: 'replace', |
| 52 from: '30, 40', |
| 53 toComposite: 'add', |
| 54 to: '50, -10' |
| 55 }, [ |
| 56 {at: -0.4, is: '18, 52'}, |
| 57 {at: 0, is: '30, 40'}, |
| 58 {at: 0.2, is: '36, 34'}, |
| 59 {at: 0.6, is: '48, 22'}, |
| 60 {at: 1.0, is: '60, 10'}, |
| 61 {at: 1.4, is: '72, -2'}, |
| 62 ]); |
| 63 |
| 64 assertAttributeInterpolation({ |
| 65 property: 'rotate', |
| 66 underlying: '', |
| 67 fromComposite: 'add', |
| 68 from: '30, 40', |
| 69 toComposite: 'replace', |
| 70 to: '50, -10' |
| 71 }, [ |
| 72 {at: -0.4, is: '22, 60'}, |
| 73 {at: 0, is: '30, 40'}, |
| 74 {at: 0.2, is: '34, 30'}, |
| 75 {at: 0.6, is: '42, 10'}, |
| 76 {at: 1.0, is: '50, -10'}, |
| 77 {at: 1.4, is: '58, -30'}, |
| 78 ]); |
| 79 </script> |
| 80 </body> |
| 81 </html> |
OLD | NEW |