OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <meta charset="UTF-8"> | 2 <meta charset="UTF-8"> |
3 <style> | |
4 .target { | |
5 position: relative; | |
6 width: 10px; | |
7 height: 10px; | |
8 background-color: black; | |
9 } | |
10 .expected { | |
11 background-color: green; | |
12 } | |
13 </style> | |
14 <body> | 3 <body> |
15 <script src="../interpolation/resources/interpolation-test.js"></script> | 4 <script src="../interpolation/resources/interpolation-test.js"></script> |
16 <script> | 5 <script> |
17 assertComposition({ | 6 assertComposition({ |
18 property: 'left', | 7 property: 'left', |
19 underlying: '50px', | 8 underlying: '50px', |
20 addFrom: '100px', | 9 addFrom: '100px', |
21 addTo: '200px', | 10 addTo: '200px', |
22 }, [ | 11 }, [ |
23 {at: -0.3, is: '120px'}, | 12 {at: -0.3, is: '120px'}, |
24 {at: 0, is: '150px'}, | 13 {at: 0, is: '150px'}, |
25 {at: 0.5, is: '200px'}, | 14 {at: 0.5, is: '200px'}, |
26 {at: 1, is: '250px'}, | 15 {at: 1, is: '250px'}, |
27 {at: 1.5, is: '300px'}, | 16 {at: 1.5, is: '300px'}, |
28 ]); | 17 ]); |
29 | 18 |
30 assertComposition({ | 19 assertComposition({ |
31 property: 'left', | 20 property: 'left', |
| 21 underlying: '100px', |
| 22 addFrom: '10px', |
| 23 addTo: '2px', |
| 24 }, [ |
| 25 {at: -0.5, is: '114px'}, |
| 26 {at: 0, is: '110px'}, |
| 27 {at: 0.5, is: '106px'}, |
| 28 {at: 1, is: '102px'}, |
| 29 {at: 1.5, is: '98px'}, |
| 30 ]); |
| 31 |
| 32 assertComposition({ |
| 33 property: 'left', |
| 34 underlying: '10%', |
| 35 addFrom: '100px', |
| 36 addTo: '20%', |
| 37 }, [ |
| 38 {at: -0.3, is: 'calc(130px + 4%)'}, |
| 39 {at: 0, is: 'calc(100px + 10%)'}, |
| 40 {at: 0.5, is: 'calc(50px + 20%)'}, |
| 41 {at: 1, is: '30%'}, |
| 42 {at: 1.5, is: 'calc(-50px + 40%)'}, |
| 43 ]); |
| 44 |
| 45 assertComposition({ |
| 46 property: 'left', |
32 underlying: '50px', | 47 underlying: '50px', |
33 addFrom: '100px', | 48 addFrom: '100px', |
34 replaceTo: '200px', | 49 replaceTo: '200px', |
35 }, [ | 50 }, [ |
36 {at: -0.3, is: '135px'}, | 51 {at: -0.3, is: '135px'}, |
37 {at: 0, is: '150px'}, | 52 {at: 0, is: '150px'}, |
38 {at: 0.5, is: '175px'}, | 53 {at: 0.5, is: '175px'}, |
39 {at: 1, is: '200px'}, | 54 {at: 1, is: '200px'}, |
40 {at: 1.5, is: '225px'}, | 55 {at: 1.5, is: '225px'}, |
41 ]); | 56 ]); |
42 | 57 |
43 assertComposition({ | 58 assertComposition({ |
44 property: 'left', | 59 property: 'left', |
45 underlying: 'auto', | 60 underlying: '100px', |
46 addFrom: '100px', | 61 addFrom: '100px', |
47 addTo: '200px', | 62 addTo: 'auto', |
48 }, [ | 63 }, [ |
49 {at: -0.3, is: '70px'}, | 64 {at: -0.3, is: '200px'}, |
50 {at: 0, is: '100px'}, | 65 {at: 0, is: '200px'}, |
51 {at: 0.5, is: '150px'}, | 66 {at: 0.5, is: 'auto'}, |
52 {at: 1, is: '200px'}, | 67 {at: 1, is: 'auto'}, |
53 {at: 1.5, is: '250px'}, | 68 {at: 1.5, is: 'auto'}, |
54 ]); | 69 ]); |
55 </script> | 70 </script> |
56 </body> | 71 </body> |
OLD | NEW |