Commit 42eb6fbd authored by Dominik Röttsches's avatar Dominik Röttsches Committed by Commit Bot

Don't exclude unassigned characters from fallback

We tripped over this when adding Unicode 11 emoji. There is no need to
introduce an additional obstacle for characters that the OS or our Emoji
fallback code might already know about but our ICU might not have been
updated yet.

Bug: 850336
Change-Id: I0748ac5b755a2d8c3b92be9c9e21cf96ed75be16
Reviewed-on: https://chromium-review.googlesource.com/1122407
Commit-Queue: Dominik Röttsches <drott@chromium.org>
Reviewed-by: default avatarEmil A Eklund <eae@chromium.org>
Reviewed-by: default avatarKoji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#572159}
parent 4ac83895
......@@ -286,7 +286,7 @@ scoped_refptr<SimpleFontData> FontCache::FallbackFontForCharacter(
UChar32 lookup_char,
const SimpleFontData* font_data_to_substitute,
FontFallbackPriority fallback_priority) {
if (Character::IsUnassignedOrPrivateUse(lookup_char))
if (Character::IsPrivateUse(lookup_char))
return nullptr;
return PlatformFallbackFontForCharacter(
description, lookup_char, font_data_to_substitute, fallback_priority);
......
......@@ -35,7 +35,7 @@ TEST(FontCache, NoFallbackForPrivateUseArea) {
FontDescription font_description;
font_description.SetGenericFamily(FontDescription::kStandardFamily);
for (UChar32 character : {0xE000, 0xE401, 0xE402, 0xE403, 0xF8FF, 0xF0000,
0xFAAAA, 0xFFFFF, 0x100000, 0x10AAAA, 0x10FFFF}) {
0xFAAAA, 0x100000, 0x10AAAA}) {
scoped_refptr<SimpleFontData> font_data =
font_cache->FallbackFontForCharacter(font_description, character,
nullptr);
......
......@@ -295,9 +295,8 @@ bool Character::IsCommonOrInheritedScript(UChar32 character) {
(script == USCRIPT_COMMON || script == USCRIPT_INHERITED);
}
bool Character::IsUnassignedOrPrivateUse(UChar32 character) {
return WTF::Unicode::Category(character) &
(WTF::Unicode::kOther_NotAssigned | WTF::Unicode::kOther_PrivateUse);
bool Character::IsPrivateUse(UChar32 character) {
return WTF::Unicode::Category(character) & WTF::Unicode::kOther_PrivateUse;
}
} // namespace blink
......@@ -183,7 +183,7 @@ class PLATFORM_EXPORT Character {
static String NormalizeSpaces(const UChar*, unsigned length);
static bool IsCommonOrInheritedScript(UChar32);
static bool IsUnassignedOrPrivateUse(UChar32);
static bool IsPrivateUse(UChar32);
private:
static bool IsCJKIdeographOrSymbolSlow(UChar32);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment