Bug 1399956 - Default to san-serif for headless font. r?jrmuizel draft
authorBrendan Dahl <brendan.dahl@gmail.com>
Thu, 21 Sep 2017 11:57:09 -0700
changeset 677767 81aa8fa29be4ec849e44518b68e1ed045365df80
parent 677766 68757d4ec78f098fb188831f720153f8a7918beb
child 677768 f07c843e0e2424a58aaf66de3ebb9e1d1ff7bdc6
push id83803
push userbmo:bdahl@mozilla.com
push dateTue, 10 Oct 2017 18:53:32 +0000
reviewersjrmuizel
bugs1399956
milestone58.0a1
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
widget/headless/HeadlessLookAndFeelGTK.cpp
--- 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;
 }