| <!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-pre.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="tests_container"> |
| |
| <div id="test"></div> |
| |
| </div> |
| |
| <script> |
| var test = document.getElementById("test"); |
| |
| // Sanity check. |
| test.style.font = "12pt/14pt sans-serif"; |
| shouldBe("test.style.getPropertyValue('font')", "'12pt/14pt sans-serif'"); |
| test.style.font = ""; |
| test.style.font = "inherit"; |
| shouldBe("test.style.getPropertyValue('font')", "'inherit'"); |
| test.style.font = ""; |
| shouldBe("test.style.getPropertyValue('font')", "''"); |
| test.style.font = "12pt/14pt inherit"; |
| shouldBe("test.style.getPropertyValue('font')", "''"); |
| test.style.font = "12pt/14pt bold inherit"; |
| shouldBe("test.style.getPropertyValue('font')", "''"); |
| test.style.font = "italic 12pt/14pt bold inherit"; |
| shouldBe("test.style.getPropertyValue('font')", "''"); |
| test.style.font = "italic 12pt/14pt bold arial inherit"; |
| shouldBe("test.style.getPropertyValue('font')", "''"); |
| test.style.font = "x-large/110% 'new century schoolbook', serif, inherit"; |
| shouldBe("test.style.getPropertyValue('font')", "''"); |
| test.style.font = " 'inherit'"; |
| shouldBe("test.style.getPropertyValue('font')", "''"); |
| test.style.font = "italic inherit 12pt/14pt bold arial inherit"; |
| shouldBe("test.style.getPropertyValue('font')", "''"); |
| test.style.font = "arial inherit"; |
| shouldBe("test.style.getPropertyValue('font')", "''"); |
| test.style.font = "Arial, Helvetica, inherit, sans-serif;"; |
| shouldBe("test.style.getPropertyValue('font')", "''"); |
| test.style.font = "inherit, sans-serif;"; |
| shouldBe("test.style.getPropertyValue('font')", "''"); |
| test.style.font = "italic inherit 12pt/14pt bold arial initial"; |
| shouldBe("test.style.getPropertyValue('font')", "''"); |
| // clean up after ourselves |
| var tests_container = document.getElementById("tests_container"); |
| tests_container.parentNode.removeChild(tests_container); |
| </script> |
| <script src="../../resources/js-test-post.js"></script> |
| </body> |
| </html> |