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

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

Issue 2161683002: Add LayoutLocale class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Test stability Created 4 years, 5 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
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 9ac701c9eda6527ac40086111123e5196cd2b89f..deca58cb17f94e03d1c40a6d9cbff895a36aad67 100644
--- a/third_party/WebKit/Source/platform/fonts/FontDescription.cpp
+++ b/third_party/WebKit/Source/platform/fonts/FontDescription.cpp
@@ -123,26 +123,6 @@ FontDescription::VariantLigatures FontDescription::getVariantLigatures() const
return ligatures;
}
-static const AtomicString& defaultLocale()
-{
- DEFINE_STATIC_LOCAL(AtomicString, locale, ());
- if (locale.isNull()) {
- AtomicString defaultLocale = defaultLanguage();
- if (!defaultLocale.isEmpty())
- locale = defaultLocale;
- else
- locale = AtomicString("en");
- }
- return locale;
-}
-
-const AtomicString& FontDescription::locale(bool includeDefault) const
-{
- if (m_locale.isNull() && includeDefault)
- return defaultLocale();
- return m_locale;
-}
-
void FontDescription::setTraits(FontTraits traits)
{
setStyle(traits.style());
@@ -284,8 +264,11 @@ unsigned FontDescription::styleHashWithoutFamilyList() const
addToHash(hash, settings->at(i).value());
}
}
- for (unsigned i = 0; i < m_locale.length(); i++)
- stringHasher.addCharacter(m_locale[i]);
+ if (m_locale) {
+ const AtomicString& locale = m_locale->localeString();
+ for (unsigned i = 0; i < locale.length(); i++)
+ stringHasher.addCharacter(locale[i]);
+ }
addToHash(hash, stringHasher.hash());
addFloatToHash(hash, m_specifiedSize);

Powered by Google App Engine
This is Rietveld 408576698