Expand font-weight and font-stretch to take any number
[WebKit.git] / LayoutTests / fast / text / font-stretch-parse.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../resources/js-test-pre.js"></script>
5 </head>
6 <body>
7 <div style="font: 16px/18px 'Times';">
8 <div id="test1"></div>
9 <div id="test2" style="font-stretch: 1%;"></div>
10 <div id="test3" style="font-stretch: 2;"></div>
11 <div id="test4" style="font-stretch: ultra-condensed;"></div>
12 <div id="test5" style="font-stretch: extra-condensed;"></div>
13 <div id="test6" style="font-stretch: condensed;"></div>
14 <div id="test7" style="font-stretch: semi-condensed;"></div>
15 <div id="test8" style="font-stretch: normal;"></div>
16 <div id="test9" style="font-stretch: semi-expanded;"></div>
17 <div id="test10" style="font-stretch: expanded;"></div>
18 <div id="test11" style="font-stretch: extra-expanded;"></div>
19 <div id="test12" style="font-stretch: ultra-expanded;"></div>
20 <div id="test13" style="font-stretch: garbage;"></div>
21 <div id="test14" style="font-stretch: initial;"></div>
22 <div id="test15" style="font-stretch: calc(3 + 4);"></div>
23 <div id="test16" style="font: 100 extra-condensed 48px/49px 'Helvetica Neue';"></div>
24 <div id="test17" style="font: extra-condensed 100 48px/49px 'Helvetica Neue';"></div>
25 <div id="test18" style="font: 100 48px/49px 'Helvetica Neue';"></div>
26 <div style="font-stretch: extra-expanded;"><div id="test19" style="font: 100 48px/49px 'Helvetica Neue';"></div></div>
27 <div id="test20" style="font: italic small-caps 100 extra-expanded 48px/49px 'Helvetica Neue';"></div>
28 </div>
29 <script>
30 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test1')).fontStretch", "normal");
31 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test2')).fontStretch", "1%");
32 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test3')).fontStretch", "2%");
33 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test4')).fontStretch", "ultra-condensed");
34 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test5')).fontStretch", "extra-condensed");
35 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test6')).fontStretch", "condensed");
36 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test7')).fontStretch", "semi-condensed");
37 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test8')).fontStretch", "normal");
38 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test9')).fontStretch", "semi-expanded");
39 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test10')).fontStretch", "expanded");
40 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test11')).fontStretch", "extra-expanded");
41 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test12')).fontStretch", "ultra-expanded");
42 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test13')).fontStretch", "normal");
43 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test14')).fontStretch", "normal");
44 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test15')).fontStretch", "7%");
45 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test16')).fontStretch", "extra-condensed");
46 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test17')).fontStretch", "extra-condensed");
47 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test18')).fontStretch", "normal");
48 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test19')).fontStretch", "normal");
49 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test20')).fontStretch", "extra-expanded");
50
51 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test1')).font", "normal normal normal normal 16px/18px Times");
52 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test2')).font", "16px/18px Times");
53 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test3')).font", "16px/18px Times");
54 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test4')).font", "normal normal normal ultra-condensed 16px/18px Times");
55 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test5')).font", "normal normal normal extra-condensed 16px/18px Times");
56 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test6')).font", "normal normal normal condensed 16px/18px Times");
57 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test7')).font", "normal normal normal semi-condensed 16px/18px Times");
58 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test8')).font", "normal normal normal normal 16px/18px Times");
59 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test9')).font", "normal normal normal semi-expanded 16px/18px Times");
60 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test10')).font", "normal normal normal expanded 16px/18px Times");
61 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test11')).font", "normal normal normal extra-expanded 16px/18px Times");
62 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test12')).font", "normal normal normal ultra-expanded 16px/18px Times");
63 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test13')).font", "normal normal normal normal 16px/18px Times");
64 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test14')).font", "normal normal normal normal 16px/18px Times");
65 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test15')).font", "16px/18px Times");
66 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test16')).font", "normal normal 100 extra-condensed 48px/49px 'Helvetica Neue'");
67 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test17')).font", "normal normal 100 extra-condensed 48px/49px 'Helvetica Neue'");
68 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test18')).font", "normal normal 100 normal 48px/49px 'Helvetica Neue'");
69 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test19')).font", "normal normal 100 normal 48px/49px 'Helvetica Neue'");
70 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test20')).font", "italic small-caps 100 extra-expanded 48px/49px 'Helvetica Neue'");
71
72 shouldBeEqualToString("document.getElementById('test1').style.font", "");
73 shouldBeEqualToString("document.getElementById('test16').style.font", "100 extra-condensed 48px/49px 'Helvetica Neue'");
74 shouldBeEqualToString("document.getElementById('test17').style.font", "100 extra-condensed 48px/49px 'Helvetica Neue'");
75 shouldBeEqualToString("document.getElementById('test18').style.font", "100 48px/49px 'Helvetica Neue'");
76 shouldBeEqualToString("document.getElementById('test19').style.font", "100 48px/49px 'Helvetica Neue'");
77 shouldBeEqualToString("document.getElementById('test20').style.font", "italic small-caps 100 extra-expanded 48px/49px 'Helvetica Neue'");
78 </script>
79 <script src="../../resources/js-test-post.js"></script>
80 </body>
81 </html>