<!DOCTYPE HTML>
<html>
<head>
<title>Test for WebKit bug 20181 : font shorthand with inherit keyword incorrectly parsed and rendered</title>
<script src="../../resources/js-test.js"></script>
</head>
<body>
<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>
<div id="console"></div>
<div id="test"></div>
<script>
    var test = document.getElementById("test");

    function setFontTest(value)
    {
        test.style.font = "";
        test.style.font = value;
        return test.style.getPropertyValue("font");
    }

    shouldBeEqualToString('setFontTest("12pt/14pt sans-serif")', '12pt / 14pt sans-serif');
    shouldBeEqualToString('setFontTest("inherit")', 'inherit');
    shouldBeEqualToString('setFontTest("")', '');
    shouldBeEqualToString('setFontTest("12pt/14pt inherit")', '');
    shouldBeEqualToString('setFontTest("12pt/14pt bold inherit")', '12pt / 14pt "bold inherit"');
    shouldBeEqualToString('setFontTest("italic 12pt/14pt bold inherit")', 'italic 12pt / 14pt "bold inherit"');
    shouldBeEqualToString('setFontTest("italic 12pt/14pt bold arial inherit")', 'italic 12pt / 14pt "bold arial inherit"');
    shouldBeEqualToString('setFontTest("italic 12pt/14pt bold arial, inherit")', '');
    shouldBeEqualToString('setFontTest("x-large/110% \'new century schoolbook\', serif, inherit")', '');
    shouldBeEqualToString('setFontTest(" \'inherit\'")', '');
    shouldBeEqualToString('setFontTest("italic inherit 12pt/14pt bold arial inherit")', '');
    shouldBeEqualToString('setFontTest("arial inherit")', '');
    shouldBeEqualToString('setFontTest("Arial, Helvetica, inherit, sans-serif;")', '');
    shouldBeEqualToString('setFontTest("inherit, sans-serif;")', '');
    shouldBeEqualToString('setFontTest("italic inherit 12pt/14pt bold arial initial")', '');

    // clean up after ourselves
    test.parentNode.removeChild(test);
</script>
</body>
</html>
