| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <meta charset="UTF-8"> | 2 <meta charset="UTF-8"> |
| 3 <style> | 3 <style> |
| 4 .target { | 4 .target { |
| 5 width: 100px; | 5 width: 100px; |
| 6 height: 100px; | 6 height: 100px; |
| 7 background-color: black; | 7 background-color: black; |
| 8 display: inline-block; | 8 display: inline-block; |
| 9 } | 9 } |
| 10 .replica { | 10 .replica { |
| 11 background-color: green; | 11 background-color: green; |
| 12 } | 12 } |
| 13 </style> | 13 </style> |
| 14 <body> | 14 <body> |
| 15 <script src="resources/interpolation-test.js"></script> | 15 <script src="resources/interpolation-test.js"></script> |
| 16 <script> | 16 <script> |
| 17 assertInterpolation({ | 17 assertInterpolation({ |
| 18 property: 'opacity', | 18 property: 'opacity', |
| 19 from: '0', | 19 from: '0', |
| 20 to: '1' | 20 to: '1' |
| 21 }, [ | 21 }, [ |
| 22 {at: -0.3, is: '0'}, // CSS opacity is [0-1]. | 22 {at: -0.3, is: '0'}, // CSS opacity is [0-1]. |
| 23 {at: 0, is: '0'}, | 23 {at: 0, is: '0'}, |
| 24 {at: 0.3, is: '0.3'}, | 24 {at: 0.3, is: '0.3'}, |
| 25 {at: 0.6, is: '0.6'}, | 25 {at: 0.6, is: '0.6'}, |
| 26 {at: 1, is: '1'}, | 26 {at: 1, is: '1'}, |
| 27 {at: 1.5, is: '1'} | 27 {at: 1.5, is: '1'} |
| 28 ]); | 28 ]); |
| 29 assertInterpolation({ |
| 30 property: 'opacity', |
| 31 from: '-2', |
| 32 to: '-4' |
| 33 }, [ |
| 34 {at: -1.25, is: '0.5'}, |
| 35 {at: -0.3, is: '0'}, // CSS opacity is [0-1]. |
| 36 {at: 0, is: '0'}, |
| 37 {at: 0.3, is: '0'}, |
| 38 {at: 0.6, is: '0'}, |
| 39 {at: 1, is: '0'}, |
| 40 {at: 1.5, is: '0'} |
| 41 ]); |
| 29 </script> | 42 </script> |
| 30 </body> | 43 </body> |
| OLD | NEW |