1 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.")
3 var testSpan
= document
.createElement("span");
4 testSpan
.innerHTML
= "test";
5 document
.body
.appendChild(testSpan
);
7 function fontSizeForFamilies(fontFamilies
)
9 testSpan
.style
.fontFamily
= fontFamilies
;
10 return window
.getComputedStyle(testSpan
, null).fontSize
;
13 // Only the exact font-family "monospace" should result in using the fixed-width font default size.
14 // This matches FireFox 3.x behavior.
15 shouldBeEqualToString("fontSizeForFamilies('monospace')", '13px');
17 // Everything else should use the standard font size:
18 shouldBeEqualToString("fontSizeForFamilies('monospace, times')", '16px');
19 shouldBeEqualToString("fontSizeForFamilies('times, monospace')", '16px');
20 shouldBeEqualToString("fontSizeForFamilies('foo')", '16px');
21 shouldBeEqualToString("fontSizeForFamilies('foo, monospace')", '16px');
23 document
.body
.removeChild(testSpan
);