Index: Source/platform/fonts/FontDescription.cpp |
diff --git a/Source/platform/fonts/FontDescription.cpp b/Source/platform/fonts/FontDescription.cpp |
index 7a9d0b9b5606b2a5ec65409bef47764fb8e55cbd..85d0035d9ede83e326602953a3484be49e24ed30 100644 |
--- a/Source/platform/fonts/FontDescription.cpp |
+++ b/Source/platform/fonts/FontDescription.cpp |
@@ -39,7 +39,7 @@ namespace blink { |
struct SameSizeAsFontDescription { |
FontFamily familyList; |
RefPtr<FontFeatureSettings> m_featureSettings; |
- String locale; |
+ AtomicString locale; |
float sizes[4]; |
// FXIME: Make them fit into one word. |
uint32_t bitfields; |
@@ -123,6 +123,21 @@ FontDescription::VariantLigatures FontDescription::variantLigatures() const |
return ligatures; |
} |
+static const AtomicString& defaultLocale() |
+{ |
+ DEFINE_STATIC_LOCAL(AtomicString, locale, ()); |
+ if (locale.isNull()) |
+ locale = AtomicString("en"); |
+ return locale; |
+} |
+ |
+const AtomicString& FontDescription::locale() const |
+{ |
+ if (m_locale.isNull()) |
+ return defaultLocale(); |
+ return m_locale; |
+} |
+ |
void FontDescription::setTraits(FontTraits traits) |
{ |
setStyle(traits.style()); |