4 <title>Test for WebKit bug 20181 : font shorthand with inherit keyword incorrectly parsed and rendered</title>
5 <script src="../js/resources/js-test-pre.js"></script>
8 <p id="description">Test for WebKit bug <a href="https://bugs.webkit.org/show_bug.cgi?id=20181">20181</a> : font shorthand with inherit keyword incorrectly parsed and rendered</p>
9 <div id="console"></div>
11 <div id="tests_container">
18 var test = document.getElementById("test");
21 test.style.font = "12pt/14pt sans-serif";
22 shouldBe("test.style.getPropertyValue('font')", "'12pt/14pt sans-serif'");
24 test.style.font = "inherit";
25 shouldBe("test.style.getPropertyValue('font')", "'inherit'");
27 shouldBe("test.style.getPropertyValue('font')", "''");
28 test.style.font = "12pt/14pt inherit";
29 shouldBe("test.style.getPropertyValue('font')", "''");
30 test.style.font = "12pt/14pt bold inherit";
31 shouldBe("test.style.getPropertyValue('font')", "''");
32 test.style.font = "italic 12pt/14pt bold inherit";
33 shouldBe("test.style.getPropertyValue('font')", "''");
34 test.style.font = "italic 12pt/14pt bold arial inherit";
35 shouldBe("test.style.getPropertyValue('font')", "''");
36 test.style.font = "x-large/110% 'new century schoolbook', serif, inherit";
37 shouldBe("test.style.getPropertyValue('font')", "''");
38 test.style.font = " 'inherit'";
39 shouldBe("test.style.getPropertyValue('font')", "''");
40 test.style.font = "italic inherit 12pt/14pt bold arial inherit";
41 shouldBe("test.style.getPropertyValue('font')", "''");
42 test.style.font = "arial inherit";
43 shouldBe("test.style.getPropertyValue('font')", "''");
44 test.style.font = "Arial, Helvetica, inherit, sans-serif;";
45 shouldBe("test.style.getPropertyValue('font')", "''");
46 test.style.font = "inherit, sans-serif;";
47 shouldBe("test.style.getPropertyValue('font')", "''");
48 test.style.font = "italic inherit 12pt/14pt bold arial initial";
49 shouldBe("test.style.getPropertyValue('font')", "''");
50 // clean up after ourselves
51 var tests_container = document.getElementById("tests_container");
52 tests_container.parentNode.removeChild(tests_container);
54 <script src="../js/resources/js-test-post.js"></script>