tizen beta release
[framework/web/webkit-efl.git] / LayoutTests / fast / css / font-shorthand.html
1 <html>
2 <head>
3 <script>
4     if (window.layoutTestController)
5         layoutTestController.dumpAsText();
6 </script>
7 </head>
8 <body>
9 <div id="foo">Test</div>
10 <script>
11 function testFontValue(value)
12 {
13     document.write("Font for '" + value + "':<br>");
14     var element = document.getElementById("foo");
15     var decl = element.style;
16     decl.font = "";
17     decl.font = value;
18     for (var i = 0; i < decl.length; i++) {
19         var shorthand = decl.getPropertyShorthand(decl[i]);
20         document.write(decl[i] + ": " + decl.getPropertyValue(decl[i]));
21         if (shorthand) {
22             document.write(" (original property was " + shorthand
23                 + (decl.isPropertyImplicit(decl[i]) ? " and property was implicitly set.)" : ")"));
24         }
25         document.write("<br>");
26     }
27     document.write("<br>");
28 }
29
30 testFontValue("12px monospace");
31 testFontValue("12px/24px serif");
32 testFontValue("normal 12px serif");
33 testFontValue("normal normal 12px serif");
34 testFontValue("normal normal normal 12px serif");
35 testFontValue("italic small-caps 12px/24px serif");
36 testFontValue("italic bold 12px/24px serif");
37 testFontValue("small-caps bold 14px/28px Arial, sans-serif");
38 testFontValue("italic small-caps bold 14px/28px Arial, sans-serif");
39
40 // Invalid values should yield no longhands.
41 testFontValue("italic small-caps bold 12px/24px");
42 testFontValue("italic small-caps bold 12px");
43 testFontValue("italic small-caps bold /12px serif");
44 </script>
45 </body>
46 </html>