| Index: third_party/WebKit/Source/platform/fonts/android/FontCacheAndroid.cpp
|
| diff --git a/third_party/WebKit/Source/platform/fonts/android/FontCacheAndroid.cpp b/third_party/WebKit/Source/platform/fonts/android/FontCacheAndroid.cpp
|
| index c580ac0160534f2202c41b5317689ebc60b9e59e..50ebfc46caf96bc0a5c5226cc7aa954c132b067f 100644
|
| --- a/third_party/WebKit/Source/platform/fonts/android/FontCacheAndroid.cpp
|
| +++ b/third_party/WebKit/Source/platform/fonts/android/FontCacheAndroid.cpp
|
| @@ -58,12 +58,19 @@ AtomicString FontCache::getGenericFamilyNameForScript(const AtomicString& family
|
| if (familyName == FontFamilyNames::webkit_monospace)
|
| return familyName;
|
|
|
| - // This is a hack to use the preferred font for CJK scripts.
|
| - // TODO(kojii): This logic disregards either generic family name
|
| - // or locale. We need an API that honors both to find appropriate
|
| - // fonts. crbug.com/642340
|
| - UChar32 examplerChar;
|
| - switch (fontDescription.script()) {
|
| + // The CJK hack below should be removed, at latest when we have
|
| + // serif and sans-serif versions of CJK fonts. Until then, limit it
|
| + // to only when the content locale is available. crbug.com/652146
|
| + const LayoutLocale* contentLocale = fontDescription.locale();
|
| + if (!contentLocale)
|
| + return familyName;
|
| +
|
| + // This is a hack to use the preferred font for CJK scripts.
|
| + // TODO(kojii): This logic disregards either generic family name
|
| + // or locale. We need an API that honors both to find appropriate
|
| + // fonts. crbug.com/642340
|
| + UChar32 examplerChar;
|
| + switch (contentLocale->script()) {
|
| case USCRIPT_SIMPLIFIED_HAN:
|
| case USCRIPT_TRADITIONAL_HAN:
|
| case USCRIPT_KATAKANA_OR_HIRAGANA:
|
|
|