Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1302)

Unified Diff: third_party/WebKit/Source/platform/fonts/FontDescription.cpp

Issue 1955523002: Fallback on system locale for font selection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/text/same-script-different-lang-in-Hindi-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/fonts/FontDescription.cpp
diff --git a/third_party/WebKit/Source/platform/fonts/FontDescription.cpp b/third_party/WebKit/Source/platform/fonts/FontDescription.cpp
index 2008681e0ccd0973e5bae08faa3d38b697a41d62..12a30d774a8d79424e84ec6f0049b3d665886764 100644
--- a/third_party/WebKit/Source/platform/fonts/FontDescription.cpp
+++ b/third_party/WebKit/Source/platform/fonts/FontDescription.cpp
@@ -29,6 +29,7 @@
#include "platform/fonts/FontDescription.h"
+#include "platform/Language.h"
#include "platform/RuntimeEnabledFeatures.h"
#include "wtf/StringHasher.h"
#include "wtf/text/AtomicStringHash.h"
@@ -125,8 +126,13 @@ FontDescription::VariantLigatures FontDescription::variantLigatures() const
static const AtomicString& defaultLocale()
{
DEFINE_STATIC_LOCAL(AtomicString, locale, ());
- if (locale.isNull())
- locale = AtomicString("en");
+ if (locale.isNull()) {
+ AtomicString defaultLocale = defaultLanguage();
+ if (!defaultLocale.isEmpty())
+ locale = defaultLocale;
+ else
+ locale = AtomicString("en");
+ }
return locale;
}
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/text/same-script-different-lang-in-Hindi-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698