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

Unified Diff: third_party/WebKit/Source/core/editing/state_machines/StateMachineUtil.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/StateMachineUtil.cpp
diff --git a/third_party/WebKit/Source/core/editing/state_machines/StateMachineUtil.cpp b/third_party/WebKit/Source/core/editing/state_machines/StateMachineUtil.cpp
index 2889d75ff00d71ebcedce18513db3bb775140807..28235cbbcc2fd348b890ac8f6bc75a712cd77d5d 100644
--- a/third_party/WebKit/Source/core/editing/state_machines/StateMachineUtil.cpp
+++ b/third_party/WebKit/Source/core/editing/state_machines/StateMachineUtil.cpp
@@ -13,15 +13,6 @@ namespace blink {
namespace {
-// Returns true if the code point has Glue_After_Zwj grapheme break property.
-// See http://www.unicode.org/Public/9.0.0/ucd/auxiliary/GraphemeBreakProperty-9.0.0d18.txt
-bool isGlueAfterZwj(uint32_t codePoint)
-{
- return codePoint == WTF::Unicode::heavyBlackHeartCharacter
- || codePoint == WTF::Unicode::kissMarkCharacter
- || codePoint == WTF::Unicode::leftSpeechBubbleCharacter;
-}
-
// Returns true if the code point has E_Basae_GAZ grapheme break property.
// See http://www.unicode.org/Public/9.0.0/ucd/auxiliary/GraphemeBreakProperty-9.0.0d18.txt
bool isEBaseGAZ(uint32_t codePoint)
@@ -128,9 +119,9 @@ bool isGraphemeBreak(UChar32 prevCodePoint, UChar32 nextCodePoint)
&& Character::isModifier(nextCodePoint))
return false;
- // Proposed Rule GB11, ZWJ x (Glue_After_Zwj | EBG)
+ // Proposed Rule GB11, ZWJ x Emoji
if (prevCodePoint == zeroWidthJoinerCharacter
- && (isGlueAfterZwj(nextCodePoint) || isEBaseGAZ(nextCodePoint)))
+ && (Character::isEmoji(nextCodePoint)))
return false;
// Rule GB999 any รท any

Powered by Google App Engine
This is Rietveld 408576698