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

Unified Diff: third_party/WebKit/Source/core/editing/state_machines/StateMachineUtilTest.cpp

Issue 1902553004: Do not break after ZWJ if the trailing character is Emoji. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add comment to isEmoji method Created 4 years, 8 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/core/editing/state_machines/StateMachineUtilTest.cpp
diff --git a/third_party/WebKit/Source/core/editing/state_machines/StateMachineUtilTest.cpp b/third_party/WebKit/Source/core/editing/state_machines/StateMachineUtilTest.cpp
index d5ab01f863bfc88ca953165c6f1d4008acc2818c..b99e759879040ae2df31e6aa4bb953c0d4563d85 100644
--- a/third_party/WebKit/Source/core/editing/state_machines/StateMachineUtilTest.cpp
+++ b/third_party/WebKit/Source/core/editing/state_machines/StateMachineUtilTest.cpp
@@ -135,16 +135,23 @@ TEST(StateMachineUtilTest, IsGraphmeBreak_ZWJSequecne)
const UChar32 kGlueAfterZwj = 0x2764;
// U+1F466 (BOY) has E_Base_GAZ grapheme property.
const UChar32 kEBaseGAZ = 0x1F466;
+ // U+1F5FA (WORLD MAP) doesn'T have Glue_After_Zwj or E_Base_GAZ property
+ // but has Emoji property.
+ const UChar32 kEmoji = 0x1F5FA;
// Grapheme Cluster Boundary Rule GB11: ZWJ x (Glue_After_Zwj | EBG)
EXPECT_FALSE(isGraphemeBreak(WTF::Unicode::zeroWidthJoinerCharacter,
kGlueAfterZwj));
EXPECT_FALSE(isGraphemeBreak(WTF::Unicode::zeroWidthJoinerCharacter,
kEBaseGAZ));
+ EXPECT_FALSE(isGraphemeBreak(WTF::Unicode::zeroWidthJoinerCharacter,
+ kEmoji));
EXPECT_TRUE(isGraphemeBreak(kGlueAfterZwj, kEBaseGAZ));
EXPECT_TRUE(isGraphemeBreak(kGlueAfterZwj, kGlueAfterZwj));
EXPECT_TRUE(isGraphemeBreak(kEBaseGAZ, kGlueAfterZwj));
+
+ EXPECT_TRUE(isGraphemeBreak(WTF::Unicode::zeroWidthJoinerCharacter, 'a'));
}
TEST(StateMachineUtilTest, IsGraphmeBreak_IndicSyllabicCategoryVirama)

Powered by Google App Engine
This is Rietveld 408576698