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 object-position: 30px 10px; |
| 6 } |
4 .target { | 7 .target { |
5 position: relative; | 8 position: relative; |
6 width: 100px; | 9 width: 100px; |
7 height: 100px; | 10 height: 100px; |
8 background-color: black; | 11 background-color: black; |
9 display: inline-block; | 12 display: inline-block; |
10 margin: 20px 0px 20px 0px; | 13 margin: 20px 0px 20px 0px; |
11 object-fit: fill; | 14 object-fit: fill; |
| 15 object-position: 10px 30px; |
12 } | 16 } |
13 .expected { | 17 .expected { |
14 background-color: green; | 18 background-color: green; |
15 } | 19 } |
16 </style> | 20 </style> |
17 <body> | 21 <body> |
18 <script src="resources/interpolation-test.js"></script> | 22 <script src="resources/interpolation-test.js"></script> |
19 <script> | 23 <script> |
| 24 assertInterpolation({ |
| 25 property: 'object-position', |
| 26 from: '', |
| 27 to: '20px 20px', |
| 28 }, [ |
| 29 {at: -0.3, is: '7px 33px'}, |
| 30 {at: 0, is: '10px 30px'}, |
| 31 {at: 0.5, is: '15px 25px'}, |
| 32 {at: 1, is: '20px 20px'}, |
| 33 {at: 1.5, is: '25px 15px'}, |
| 34 ]); |
20 | 35 |
21 assertInterpolation({ | 36 assertInterpolation({ |
22 property: 'object-position', | 37 property: 'object-position', |
| 38 from: 'initial', |
| 39 to: '20px 20px', |
| 40 }, [ |
| 41 {at: -0.3, is: 'calc(-6px + 65%) calc(-6px + 65%)'}, |
| 42 {at: 0, is: '50% 50%'}, |
| 43 {at: 0.5, is: 'calc(10px + 25%) calc(10px + 25%)'}, |
| 44 {at: 1, is: '20px 20px'}, |
| 45 {at: 1.5, is: 'calc(30px + -25%) calc(30px + -25%)'}, |
| 46 ]); |
| 47 |
| 48 assertInterpolation({ |
| 49 property: 'object-position', |
| 50 from: 'inherit', |
| 51 to: '20px 20px', |
| 52 }, [ |
| 53 {at: -0.3, is: '33px 7px'}, |
| 54 {at: 0, is: '30px 10px'}, |
| 55 {at: 0.5, is: '25px 15px'}, |
| 56 {at: 1, is: '20px 20px'}, |
| 57 {at: 1.5, is: '15px 25px'}, |
| 58 ]); |
| 59 |
| 60 assertInterpolation({ |
| 61 property: 'object-position', |
| 62 from: 'unset', |
| 63 to: '20px 20px', |
| 64 }, [ |
| 65 {at: -0.3, is: 'calc(-6px + 65%) calc(-6px + 65%)'}, |
| 66 {at: 0, is: '50% 50%'}, |
| 67 {at: 0.5, is: 'calc(10px + 25%) calc(10px + 25%)'}, |
| 68 {at: 1, is: '20px 20px'}, |
| 69 {at: 1.5, is: 'calc(30px + -25%) calc(30px + -25%)'}, |
| 70 ]); |
| 71 |
| 72 assertInterpolation({ |
| 73 property: 'object-position', |
23 from: '50% 50%', | 74 from: '50% 50%', |
24 to: '100% 100%' | 75 to: '100% 100%' |
25 }, [ | 76 }, [ |
26 {at: -0.3, is: '35% 35%'}, | 77 {at: -0.3, is: '35% 35%'}, |
27 {at: 0, is: '50% 50%'}, | 78 {at: 0, is: '50% 50%'}, |
28 {at: 0.5, is: '75% 75%'}, | 79 {at: 0.5, is: '75% 75%'}, |
29 {at: 1, is: '100% 100%'}, | 80 {at: 1, is: '100% 100%'}, |
30 {at: 1.5, is: '125% 125%'} | 81 {at: 1.5, is: '125% 125%'} |
31 ]); | 82 ]); |
32 | 83 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 to: 'top right' | 124 to: 'top right' |
74 }, [ | 125 }, [ |
75 {at: -0.3, is: '35% 65%'}, | 126 {at: -0.3, is: '35% 65%'}, |
76 {at: 0, is: '50% 50%'}, | 127 {at: 0, is: '50% 50%'}, |
77 {at: 0.5, is: '75% 25%'}, | 128 {at: 0.5, is: '75% 25%'}, |
78 {at: 1, is: '100% 0%'}, | 129 {at: 1, is: '100% 0%'}, |
79 {at: 1.5, is: '125% -25%'} | 130 {at: 1.5, is: '125% -25%'} |
80 ]); | 131 ]); |
81 </script> | 132 </script> |
82 </body> | 133 </body> |
OLD | NEW |