| 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 lighting-color: blue; |
| 9 } |
| 10 .target { |
| 11 lighting-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 <feSpecularLighting result="lightingOut" specularExponent="20" class="t
arget"> | 23 <feSpecularLighting result="lightingOut" specularExponent="20" class="t
arget"> |
| 19 <fePointLight x="50" y="100" z="200"> | 24 <fePointLight x="50" y="100" z="200"> |
| 20 </feSpecularLighting> | 25 </feSpecularLighting> |
| 21 <feComposite in="SourceGraphic" in2="lightingOut" operator="arithmetic"
k1="0" k2="1" k3="1" k4="0"> | 26 <feComposite in="SourceGraphic" in2="lightingOut" operator="arithmetic"
k1="0" k2="1" k3="1" k4="0"> |
| 22 </filter> | 27 </filter> |
| 23 </defs> | 28 </defs> |
| 24 <rect width="100" height="100"></rect> | 29 <rect width="10" height="100"></rect> |
| 25 </svg> | 30 </svg> |
| 26 </template> | 31 </template> |
| 27 <script src="resources/interpolation-test.js"></script> | 32 <script src="resources/interpolation-test.js"></script> |
| 28 <script> | 33 <script> |
| 29 assertInterpolation({ | 34 assertInterpolation({ |
| 30 property: 'lighting-color', | 35 property: 'lighting-color', |
| 36 from: '', |
| 37 to: 'green', |
| 38 }, [ |
| 39 {at: -5, is: 'rgb(255, 255, 0)'}, |
| 40 {at: -0.4, is: 'rgb(255, 180, 0)'}, |
| 41 {at: 0, is: 'rgb(255, 165, 0)'}, |
| 42 {at: 0.2, is: 'rgb(204, 158, 0)'}, |
| 43 {at: 0.6, is: 'rgb(102, 143, 0)'}, |
| 44 {at: 1, is: 'rgb(0, 128, 0)'}, |
| 45 {at: 1.5, is: 'rgb(0, 110, 0)'}, |
| 46 ]); |
| 47 |
| 48 assertInterpolation({ |
| 49 property: 'lighting-color', |
| 50 from: 'initial', |
| 51 to: 'green', |
| 52 }, [ |
| 53 {at: -5, is: 'rgb(255, 255, 255)'}, |
| 54 {at: -0.4, is: 'rgb(255, 255, 255)'}, |
| 55 {at: 0, is: 'rgb(255, 255, 255)'}, |
| 56 {at: 0.2, is: 'rgb(204, 230, 204)'}, |
| 57 {at: 0.6, is: 'rgb(102, 179, 102)'}, |
| 58 {at: 1, is: 'rgb(0, 128, 0)'}, |
| 59 {at: 1.5, is: 'rgb(0, 65, 0)'}, |
| 60 ]); |
| 61 |
| 62 assertInterpolation({ |
| 63 property: 'lighting-color', |
| 64 from: 'inherit', |
| 65 to: 'green', |
| 66 }, [ |
| 67 {at: -5, is: 'rgb(0, 0, 255)'}, |
| 68 {at: -0.4, is: 'rgb(0, 0, 255)'}, |
| 69 {at: 0, is: 'rgb(0, 0, 255)'}, |
| 70 {at: 0.2, is: 'rgb(0, 26, 204)'}, |
| 71 {at: 0.6, is: 'rgb(0, 77, 102)'}, |
| 72 {at: 1, is: 'rgb(0, 128, 0)'}, |
| 73 {at: 1.5, is: 'rgb(0, 192, 0)'}, |
| 74 ]); |
| 75 |
| 76 assertInterpolation({ |
| 77 property: 'lighting-color', |
| 78 from: 'unset', |
| 79 to: 'green', |
| 80 }, [ |
| 81 {at: -5, is: 'rgb(255, 255, 255)'}, |
| 82 {at: -0.4, is: 'rgb(255, 255, 255)'}, |
| 83 {at: 0, is: 'rgb(255, 255, 255)'}, |
| 84 {at: 0.2, is: 'rgb(204, 230, 204)'}, |
| 85 {at: 0.6, is: 'rgb(102, 179, 102)'}, |
| 86 {at: 1, is: 'rgb(0, 128, 0)'}, |
| 87 {at: 1.5, is: 'rgb(0, 65, 0)'}, |
| 88 ]); |
| 89 |
| 90 assertInterpolation({ |
| 91 property: 'lighting-color', |
| 31 from: 'orange', | 92 from: 'orange', |
| 32 to: 'blue' | 93 to: 'blue' |
| 33 }, [ | 94 }, [ |
| 34 {at: -5, is: '#ffff00'}, | 95 {at: -5, is: '#ffff00'}, |
| 35 {at: -0.4, is: '#ffe700'}, | 96 {at: -0.4, is: '#ffe700'}, |
| 36 {at: 0, is: 'orange'}, // ffa500 | 97 {at: 0, is: 'orange'}, // ffa500 |
| 37 {at: 0.2, is: '#cc8433'}, | 98 {at: 0.2, is: '#cc8433'}, |
| 38 {at: 0.6, is: '#664299'}, | 99 {at: 0.6, is: '#664299'}, |
| 39 {at: 1, is: 'blue'}, // 0000ff | 100 {at: 1, is: 'blue'}, // 0000ff |
| 40 {at: 1.5, is: 'blue'} | 101 {at: 1.5, is: 'blue'} |
| 41 ]); | 102 ]); |
| 42 </script> | 103 </script> |
| 43 </body> | 104 </body> |
| OLD | NEW |