Bug 1399956 - Default to san-serif for headless font. r?jrmuizel
Fixes problem with the initial computed value of font-family
being empty and not matching the later value in
test_value_storage.html.
MozReview-Commit-ID: HOHvMZPP1GD
--- a/widget/headless/HeadlessLookAndFeelGTK.cpp
+++ b/widget/headless/HeadlessLookAndFeelGTK.cpp
@@ -324,29 +324,24 @@ HeadlessLookAndFeel::GetFloatImpl(FloatI
return res;
}
bool
HeadlessLookAndFeel::GetFontImpl(FontID aID, nsString& aFontName,
gfxFontStyle& aFontStyle,
float aDevPixPerCSSPixel)
{
- // Copied over from the Cocoa equivalent to this file. Hopefully it's good
- // enough here.
- if (aID == eFont_Window || aID == eFont_Document) {
- aFontStyle.style = NS_FONT_STYLE_NORMAL;
- aFontStyle.weight = NS_FONT_WEIGHT_NORMAL;
- aFontStyle.stretch = NS_FONT_STRETCH_NORMAL;
- aFontStyle.size = 14 * aDevPixPerCSSPixel;
- aFontStyle.systemFont = true;
+ // Default to san-serif for everything.
+ aFontStyle.style = NS_FONT_STYLE_NORMAL;
+ aFontStyle.weight = NS_FONT_WEIGHT_NORMAL;
+ aFontStyle.stretch = NS_FONT_STRETCH_NORMAL;
+ aFontStyle.size = 14 * aDevPixPerCSSPixel;
+ aFontStyle.systemFont = true;
- aFontName.AssignLiteral("sans-serif");
- return true;
- }
-
+ aFontName.AssignLiteral("sans-serif");
return true;
}
char16_t
HeadlessLookAndFeel::GetPasswordCharacterImpl()
{
return UNICODE_BULLET;
}