| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <meta charset="UTF-8"> | 2 <meta charset="UTF-8"> |
| 3 <style> | 3 <style> |
| 4 svg { | 4 .container { |
| 5 width: 100px; | 5 display: inline-block; |
| 6 height: 100px; | |
| 7 } | 6 } |
| 8 svg rect { | 7 .parent { |
| 8 flood-color: blue; |
| 9 } |
| 10 .target { |
| 11 flood-color: orange; |
| 12 } |
| 13 rect { |
| 9 fill: black; | 14 fill: black; |
| 10 filter: url(#test); | 15 filter: url(#test); |
| 11 } | 16 } |
| 12 </style> | 17 </style> |
| 13 <body> | 18 <body> |
| 14 <template id="target-template"> | 19 <template id="target-template"> |
| 15 <svg> | 20 <svg width="10" height="100"> |
| 16 <defs> | 21 <defs> |
| 17 <filter id="test"> | 22 <filter id="test"> |
| 18 <feFlood class="target"></feFlood> | 23 <feFlood class="target"></feFlood> |
| 19 </filter> | 24 </filter> |
| 20 </defs> | 25 </defs> |
| 21 <rect width="100" height="100"></rect> | 26 <rect width="10" height="100"></rect> |
| 22 </svg> | 27 </svg> |
| 23 </template> | 28 </template> |
| 24 <script src="resources/interpolation-test.js"></script> | 29 <script src="resources/interpolation-test.js"></script> |
| 25 <script> | 30 <script> |
| 26 assertInterpolation({ | 31 assertInterpolation({ |
| 27 property: 'flood-color', | 32 property: 'flood-color', |
| 33 from: '', |
| 34 to: 'green', |
| 35 }, [ |
| 36 {at: -5, is: 'rgb(255, 255, 0)'}, |
| 37 {at: -0.4, is: 'rgb(255, 180, 0)'}, |
| 38 {at: 0, is: 'rgb(255, 165, 0)'}, |
| 39 {at: 0.2, is: 'rgb(204, 158, 0)'}, |
| 40 {at: 0.6, is: 'rgb(102, 143, 0)'}, |
| 41 {at: 1, is: 'rgb(0, 128, 0)'}, |
| 42 {at: 1.5, is: 'rgb(0, 110, 0)'}, |
| 43 ]); |
| 44 |
| 45 assertInterpolation({ |
| 46 property: 'flood-color', |
| 47 from: 'initial', |
| 48 to: 'green', |
| 49 }, [ |
| 50 {at: -5, is: 'rgb(0, 0, 0)'}, |
| 51 {at: -0.4, is: 'rgb(0, 0, 0)'}, |
| 52 {at: 0, is: 'rgb(0, 0, 0)'}, |
| 53 {at: 0.2, is: 'rgb(0, 26, 0)'}, |
| 54 {at: 0.6, is: 'rgb(0, 77, 0)'}, |
| 55 {at: 1, is: 'rgb(0, 128, 0)'}, |
| 56 {at: 1.5, is: 'rgb(0, 192, 0)'}, |
| 57 ]); |
| 58 |
| 59 assertInterpolation({ |
| 60 property: 'flood-color', |
| 61 from: 'inherit', |
| 62 to: 'green', |
| 63 }, [ |
| 64 {at: -5, is: 'rgb(0, 0, 255)'}, |
| 65 {at: -0.4, is: 'rgb(0, 0, 255)'}, |
| 66 {at: 0, is: 'rgb(0, 0, 255)'}, |
| 67 {at: 0.2, is: 'rgb(0, 26, 204)'}, |
| 68 {at: 0.6, is: 'rgb(0, 77, 102)'}, |
| 69 {at: 1, is: 'rgb(0, 128, 0)'}, |
| 70 {at: 1.5, is: 'rgb(0, 192, 0)'}, |
| 71 ]); |
| 72 |
| 73 assertInterpolation({ |
| 74 property: 'flood-color', |
| 75 from: 'unset', |
| 76 to: 'green', |
| 77 }, [ |
| 78 {at: -5, is: 'rgb(0, 0, 0)'}, |
| 79 {at: -0.4, is: 'rgb(0, 0, 0)'}, |
| 80 {at: 0, is: 'rgb(0, 0, 0)'}, |
| 81 {at: 0.2, is: 'rgb(0, 26, 0)'}, |
| 82 {at: 0.6, is: 'rgb(0, 77, 0)'}, |
| 83 {at: 1, is: 'rgb(0, 128, 0)'}, |
| 84 {at: 1.5, is: 'rgb(0, 192, 0)'}, |
| 85 ]); |
| 86 |
| 87 assertInterpolation({ |
| 88 property: 'flood-color', |
| 28 from: 'orange', | 89 from: 'orange', |
| 29 to: 'blue' | 90 to: 'blue' |
| 30 }, [ | 91 }, [ |
| 31 {at: -5, is: '#ffff00'}, | 92 {at: -5, is: '#ffff00'}, |
| 32 {at: -0.4, is: '#ffe700'}, | 93 {at: -0.4, is: '#ffe700'}, |
| 33 {at: 0, is: 'orange'}, // ffa500 | 94 {at: 0, is: 'orange'}, // ffa500 |
| 34 {at: 0.2, is: '#cc8433'}, | 95 {at: 0.2, is: '#cc8433'}, |
| 35 {at: 0.6, is: '#664299'}, | 96 {at: 0.6, is: '#664299'}, |
| 36 {at: 1, is: 'blue'}, // 0000ff | 97 {at: 1, is: 'blue'}, // 0000ff |
| 37 {at: 1.5, is: 'blue'} | 98 {at: 1.5, is: 'blue'} |
| 38 ]); | 99 ]); |
| 39 </script> | 100 </script> |
| 40 </body> | 101 </body> |
| OLD | NEW |