blob: 124bd5f2506765f826cc204013e86f86f15ac2fc [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../../../resources/js-test-pre.js"></script>
</head>
<body>
<script>
description("Test that only exactly 'font-family: monospace;' causes use of fixed-width font default size. All other font family and font family combinations should use the standard default size.")
var testSpan = document.createElement("span");
testSpan.innerHTML = "test";
document.body.appendChild(testSpan);
function fontSizeForFamilies(fontFamilies)
{
testSpan.style.fontFamily = fontFamilies;
return window.getComputedStyle(testSpan, null).fontSize;
}
// Only the exact font-family "monospace" should result in using the fixed-width font default size.
// This matches FireFox 3.x behavior.
shouldBeEqualToString("fontSizeForFamilies('monospace')", '13px');
// Everything else should use the standard font size:
shouldBeEqualToString("fontSizeForFamilies('monospace, times')", '16px');
shouldBeEqualToString("fontSizeForFamilies('times, monospace')", '16px');
shouldBeEqualToString("fontSizeForFamilies('foo')", '16px');
shouldBeEqualToString("fontSizeForFamilies('foo, monospace')", '16px');
document.body.removeChild(testSpan);
</script>
<script src="../../../resources/js-test-post.js"></script>
</body>
</html>