OLD | NEW |
1 <!doctype html> | 1 <!DOCTYPE html> |
2 <style> | 2 <style> |
3 @font-face { | 3 @font-face { |
4 font-family: 'WebKit WeightWatcher'; | 4 font-family: 'WebKit WeightWatcher'; |
5 font-weight: 100; | 5 font-weight: 100; |
6 src: url('../../resources/WebKitWeightWatcher100.ttf'); | 6 src: url('../../resources/WebKitWeightWatcher100.ttf'); |
7 } | 7 } |
8 @font-face { | 8 @font-face { |
9 font-family: 'WebKit WeightWatcher'; | 9 font-family: 'WebKit WeightWatcher'; |
10 font-weight: 200; | 10 font-weight: 200; |
11 src: url('../../resources/WebKitWeightWatcher200.ttf'); | 11 src: url('../../resources/WebKitWeightWatcher200.ttf'); |
12 } | 12 } |
13 @font-face { | 13 @font-face { |
14 font-family: 'WebKit WeightWatcher'; | 14 font-family: 'WebKit WeightWatcher'; |
15 font-weight: 300; | 15 font-weight: 300; |
16 src: url('../../resources/WebKitWeightWatcher300.ttf'); | 16 src: url('../../resources/WebKitWeightWatcher300.ttf'); |
17 } | 17 } |
18 @font-face { | 18 @font-face { |
19 font-family: 'WebKit WeightWatcher'; | 19 font-family: 'WebKit WeightWatcher'; |
20 font-weight: 400; | 20 font-weight: 400; |
21 src: url('../../resources/WebKitWeightWatcher400.ttf'); | 21 src: url('../../resources/WebKitWeightWatcher400.ttf'); |
22 } | 22 } |
23 @font-face { | 23 @font-face { |
24 font-family: 'WebKit WeightWatcher'; | 24 font-family: 'WebKit WeightWatcher'; |
25 font-weight: 500; | 25 font-weight: 500; |
26 src: url('../../resources/WebKitWeightWatcher500.ttf'); | 26 src: url('../../resources/WebKitWeightWatcher500.ttf'); |
27 } | 27 } |
28 @font-face { | 28 @font-face { |
29 font-family: 'WebKit WeightWatcher'; | 29 font-family: 'WebKit WeightWatcher'; |
30 font-weight: 600; | 30 font-weight: 600; |
31 src: url('../../resources/WebKitWeightWatcher600.ttf'); | 31 src: url('../../resources/WebKitWeightWatcher600.ttf'); |
32 } | 32 } |
33 @font-face { | 33 @font-face { |
34 font-family: 'WebKit WeightWatcher'; | 34 font-family: 'WebKit WeightWatcher'; |
35 font-weight: 700; | 35 font-weight: 700; |
36 src: url('../../resources/WebKitWeightWatcher700.ttf'); | 36 src: url('../../resources/WebKitWeightWatcher700.ttf'); |
37 } | 37 } |
38 @font-face { | 38 @font-face { |
39 font-family: 'WebKit WeightWatcher'; | 39 font-family: 'WebKit WeightWatcher'; |
40 font-weight: 800; | 40 font-weight: 800; |
41 src: url('../../resources/WebKitWeightWatcher800.ttf'); | 41 src: url('../../resources/WebKitWeightWatcher800.ttf'); |
42 } | 42 } |
43 @font-face { | 43 @font-face { |
44 font-family: 'WebKit WeightWatcher'; | 44 font-family: 'WebKit WeightWatcher'; |
45 font-weight: 900; | 45 font-weight: 900; |
46 src: url('../../resources/WebKitWeightWatcher900.ttf'); | 46 src: url('../../resources/WebKitWeightWatcher900.ttf'); |
47 } | 47 } |
48 | 48 |
49 .target { | 49 .parent { |
50 display: inline-block; | 50 font-weight: 500; |
51 font-family: 'WebKit WeightWatcher'; | 51 } |
52 font-size: 20px; | 52 .target { |
53 } | 53 display: inline-block; |
54 .expected { | 54 font-family: 'WebKit WeightWatcher'; |
55 color: green; | 55 font-size: 20px; |
56 margin-right: 30px; | 56 font-weight: 700; |
57 } | 57 } |
58 | 58 .expected { |
| 59 color: green; |
| 60 margin-right: 30px; |
| 61 } |
59 </style> | 62 </style> |
60 <template id="target-template">A</template> | 63 <template id="target-template">A</template> |
61 <script src="resources/interpolation-test.js"></script> | 64 <script src="resources/interpolation-test.js"></script> |
62 <script> | 65 <script> |
63 assertInterpolation({ | 66 assertInterpolation({ |
64 property: 'font-weight', | 67 property: 'font-weight', |
65 from: '100', | 68 from: '', |
66 to: '900' | 69 to: '900', |
67 }, [ | 70 }, [ |
68 {at: 0/8, is: '100'}, | 71 {at: -0.3, is: '600'}, |
69 {at: 1/8, is: '200'}, | 72 {at: 0, is: 'bold'}, |
70 {at: 2/8, is: '300'}, | 73 {at: 0.3, is: '800'}, |
71 {at: 3/8, is: '400'}, | 74 {at: 0.5, is: '800'}, |
72 {at: 4/8, is: '500'}, | 75 {at: 0.6, is: '800'}, |
73 {at: 5/8, is: '600'}, | 76 {at: 1, is: '900'}, |
74 {at: 6/8, is: '700'}, | 77 {at: 1.5, is: '900'}, |
75 {at: 7/8, is: '800'}, | 78 ]); |
76 {at: 8/8, is: '900'}, | |
77 | 79 |
78 {at: 0.10/8, is: '100'}, | 80 assertInterpolation({ |
79 {at: 0.49/8, is: '100'}, | 81 property: 'font-weight', |
80 {at: 0.50/8, is: '200'}, | 82 from: 'initial', |
81 {at: 0.51/8, is: '200'}, | 83 to: '900', |
82 {at: 0.90/8, is: '200'}, | 84 }, [ |
83 {at: 7.10/8, is: '800'}, | 85 {at: -0.3, is: '300'}, |
84 {at: 7.49/8, is: '800'}, | 86 {at: 0, is: 'normal'}, |
85 {at: 7.50/8, is: '900'}, | 87 {at: 0.3, is: '600'}, |
86 {at: 7.51/8, is: '900'}, | 88 {at: 0.5, is: 'bold'}, |
| 89 {at: 0.6, is: 'bold'}, |
| 90 {at: 1, is: '900'}, |
| 91 {at: 1.5, is: '900'}, |
| 92 ]); |
87 | 93 |
88 {at: -0.1, is: '100'}, | 94 assertInterpolation({ |
89 {at: 1.1, is: '900'}, | 95 property: 'font-weight', |
90 ]); | 96 from: 'inherit', |
| 97 to: '900', |
| 98 }, [ |
| 99 {at: -0.3, is: 'normal'}, |
| 100 {at: 0, is: '500'}, |
| 101 {at: 0.3, is: '600'}, |
| 102 {at: 0.5, is: 'bold'}, |
| 103 {at: 0.6, is: 'bold'}, |
| 104 {at: 1, is: '900'}, |
| 105 {at: 1.5, is: '900'}, |
| 106 ]); |
| 107 |
| 108 assertInterpolation({ |
| 109 property: 'font-weight', |
| 110 from: 'unset', |
| 111 to: '900', |
| 112 }, [ |
| 113 {at: -0.3, is: 'normal'}, |
| 114 {at: 0, is: '500'}, |
| 115 {at: 0.3, is: '600'}, |
| 116 {at: 0.5, is: 'bold'}, |
| 117 {at: 0.6, is: 'bold'}, |
| 118 {at: 1, is: '900'}, |
| 119 {at: 1.5, is: '900'}, |
| 120 ]); |
| 121 |
| 122 assertInterpolation({ |
| 123 property: 'font-weight', |
| 124 from: '100', |
| 125 to: '900' |
| 126 }, [ |
| 127 {at: 0/8, is: '100'}, |
| 128 {at: 1/8, is: '200'}, |
| 129 {at: 2/8, is: '300'}, |
| 130 {at: 3/8, is: '400'}, |
| 131 {at: 4/8, is: '500'}, |
| 132 {at: 5/8, is: '600'}, |
| 133 {at: 6/8, is: '700'}, |
| 134 {at: 7/8, is: '800'}, |
| 135 {at: 8/8, is: '900'}, |
| 136 |
| 137 {at: 0.10/8, is: '100'}, |
| 138 {at: 0.49/8, is: '100'}, |
| 139 {at: 0.50/8, is: '200'}, |
| 140 {at: 0.51/8, is: '200'}, |
| 141 {at: 0.90/8, is: '200'}, |
| 142 {at: 7.10/8, is: '800'}, |
| 143 {at: 7.49/8, is: '800'}, |
| 144 {at: 7.50/8, is: '900'}, |
| 145 {at: 7.51/8, is: '900'}, |
| 146 |
| 147 {at: -0.1, is: '100'}, |
| 148 {at: 1.1, is: '900'}, |
| 149 ]); |
91 </script> | 150 </script> |
OLD | NEW |