OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <meta charset="UTF-8"> | 2 <meta charset="UTF-8"> |
3 <style> | 3 <style> |
| 4 .parent { |
| 5 margin: 10px; |
| 6 border: solid; |
| 7 display: inline-block; |
| 8 } |
4 .target { | 9 .target { |
5 width: 100px; | 10 width: 40px; |
6 height: 100px; | 11 height: 40px; |
7 background-color: black; | 12 background-color: black; |
8 display: inline-block; | 13 display: inline-block; |
| 14 margin: 30px; |
| 15 opacity: 0.5; |
9 } | 16 } |
10 .expected { | 17 .expected { |
11 background-color: green; | 18 background-color: green; |
12 } | 19 } |
13 </style> | 20 </style> |
14 <body> | 21 <body> |
| 22 <template id="target-template"> |
| 23 <div> |
| 24 <div class="target"></div> |
| 25 </div> |
| 26 </template> |
15 <script src="resources/interpolation-test.js"></script> | 27 <script src="resources/interpolation-test.js"></script> |
16 <script> | 28 <script> |
17 assertInterpolation({ | 29 assertInterpolation({ |
18 property: 'margin', | 30 property: 'margin', |
| 31 from: '', |
| 32 to: '20px', |
| 33 }, [ |
| 34 {at: -0.3, is: '33px'}, |
| 35 {at: 0, is: '30px'}, |
| 36 {at: 0.3, is: '27px'}, |
| 37 {at: 0.6, is: '24px'}, |
| 38 {at: 1, is: '20px'}, |
| 39 {at: 1.5, is: '15px'}, |
| 40 ]); |
| 41 |
| 42 assertInterpolation({ |
| 43 property: 'margin', |
| 44 from: 'initial', |
| 45 to: '20px', |
| 46 }, [ |
| 47 {at: -0.3, is: '-6px'}, |
| 48 {at: 0, is: '0px'}, |
| 49 {at: 0.3, is: '6px'}, |
| 50 {at: 0.6, is: '12px'}, |
| 51 {at: 1, is: '20px'}, |
| 52 {at: 1.5, is: '30px'}, |
| 53 ]); |
| 54 |
| 55 assertInterpolation({ |
| 56 property: 'margin', |
| 57 from: 'inherit', |
| 58 to: '20px', |
| 59 }, [ |
| 60 {at: -0.3, is: '7px'}, |
| 61 {at: 0, is: '10px'}, |
| 62 {at: 0.3, is: '13px'}, |
| 63 {at: 0.6, is: '16px'}, |
| 64 {at: 1, is: '20px'}, |
| 65 {at: 1.5, is: '25px'}, |
| 66 ]); |
| 67 |
| 68 assertInterpolation({ |
| 69 property: 'margin', |
| 70 from: 'unset', |
| 71 to: '20px', |
| 72 }, [ |
| 73 {at: -0.3, is: '-6px'}, |
| 74 {at: 0, is: '0px'}, |
| 75 {at: 0.3, is: '6px'}, |
| 76 {at: 0.6, is: '12px'}, |
| 77 {at: 1, is: '20px'}, |
| 78 {at: 1.5, is: '30px'}, |
| 79 ]); |
| 80 |
| 81 assertInterpolation({ |
| 82 property: 'margin', |
19 from: '0px', | 83 from: '0px', |
20 to: '10px' | 84 to: '10px' |
21 }, [ | 85 }, [ |
22 {at: -0.3, is: '-3px'}, | 86 {at: -0.3, is: '-3px'}, |
23 {at: 0, is: '0px'}, | 87 {at: 0, is: '0px'}, |
24 {at: 0.3, is: '3px'}, | 88 {at: 0.3, is: '3px'}, |
25 {at: 0.6, is: '6px'}, | 89 {at: 0.6, is: '6px'}, |
26 {at: 1, is: '10px'}, | 90 {at: 1, is: '10px'}, |
27 {at: 1.5, is: '15px'} | 91 {at: 1.5, is: '15px'} |
28 ]); | 92 ]); |
29 </script> | 93 </script> |
30 </body> | 94 </body> |
OLD | NEW |