4 if (window.layoutTestController)
5 layoutTestController.dumpAsText();
9 <div id="foo">Test</div>
11 function testFontValue(value)
13 document.write("Font for '" + value + "':<br>");
14 var element = document.getElementById("foo");
15 var decl = element.style;
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]));
22 document.write(" (original property was " + shorthand
23 + (decl.isPropertyImplicit(decl[i]) ? " and property was implicitly set.)" : ")"));
25 document.write("<br>");
27 document.write("<br>");
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");
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");