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

Unified Diff: third_party/WebKit/Source/core/editing/EditingUtilitiesTest.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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/state_machines/BackspaceStateMachine.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/editing/EditingUtilitiesTest.cpp
diff --git a/third_party/WebKit/Source/core/editing/EditingUtilitiesTest.cpp b/third_party/WebKit/Source/core/editing/EditingUtilitiesTest.cpp
index 024594ab16286deace7b595c5441dd3da6e6865b..cb84abc87a712237507a64ed04f7385262b26058 100644
--- a/third_party/WebKit/Source/core/editing/EditingUtilitiesTest.cpp
+++ b/third_party/WebKit/Source/core/editing/EditingUtilitiesTest.cpp
@@ -550,6 +550,15 @@ TEST_F(EditingUtilitiesTest, uncheckedPreviousNextOffset)
EXPECT_EQ(4, nextGraphemeBoundaryOf(node, 0));
EXPECT_EQ(5, nextGraphemeBoundaryOf(node, 4));
+ // Not only Glue_After_ZWJ or EBG but also other emoji shouldn't break
+ // before ZWJ.
+ // U+1F5FA(WORLD MAP) doesn't have either Glue_After_Zwj or EBG but has
+ // Emoji property.
+ setBodyContent("<p id='target'>&#x200D;&#x1F5FA;</p>");
+ node = document().getElementById("target")->firstChild();
+ EXPECT_EQ(0, previousGraphemeBoundaryOf(node, 3));
+ EXPECT_EQ(3, nextGraphemeBoundaryOf(node, 0));
+
// GB999: Otherwise break everywhere.
// Breaks between Hangul syllable except for GB6, GB7, GB8.
setBodyContent("<p id='target'>" + L + T + "</p>");
@@ -626,9 +635,9 @@ TEST_F(EditingUtilitiesTest, uncheckedPreviousNextOffset)
// For GB11, if trailing character is not Glue_After_Zwj or EBG, break happens after ZWJ.
// U+1F5FA(WORLD MAP) doesn't have either Glue_After_Zwj or EBG.
- setBodyContent("<p id='target'>&#x200D;&#x1F5FA;</p>");
+ setBodyContent("<p id='target'>&#x200D;a</p>");
node = document().getElementById("target")->firstChild();
- EXPECT_EQ(1, previousGraphemeBoundaryOf(node, 3));
+ EXPECT_EQ(1, previousGraphemeBoundaryOf(node, 2));
EXPECT_EQ(1, nextGraphemeBoundaryOf(node, 0));
}
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/state_machines/BackspaceStateMachine.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698