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

Unified Diff: Source/core/rendering/RenderText.cpp

Issue 27169003: Enable correct behaviour for deleting regional indicator symbols (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: apply suggestions Created 7 years, 2 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 | « LayoutTests/platform/linux/editing/deleting/regional-indicators-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderText.cpp
diff --git a/Source/core/rendering/RenderText.cpp b/Source/core/rendering/RenderText.cpp
index 871e01d6bd76efcf2f8bfda1c17ff7117b1c20e6..d639fa3feda5331c7352a6fc9d4bd5b16099b1e3 100644
--- a/Source/core/rendering/RenderText.cpp
+++ b/Source/core/rendering/RenderText.cpp
@@ -1672,7 +1672,7 @@ int RenderText::previousOffset(int current) const
return result;
}
-#if OS(MACOSX)
+#if OS(MACOSX) || OS(LINUX)
lgombos 2013/10/31 02:18:51 Should this be OS(POSIX) instead to include Androi
#define HANGUL_CHOSEONG_START (0x1100)
#define HANGUL_CHOSEONG_END (0x115F)
@@ -1714,7 +1714,7 @@ inline bool isRegionalIndicator(UChar32 c)
int RenderText::previousOffsetForBackwardDeletion(int current) const
{
-#if OS(MACOSX)
+#if OS(MACOSX) || OS(LINUX)
ASSERT(m_text);
StringImpl& text = *m_text.impl();
UChar32 character;
@@ -1757,7 +1757,6 @@ int RenderText::previousOffsetForBackwardDeletion(int current) const
character = text.characterStartingAt(current);
if (((character >= HANGUL_CHOSEONG_START) && (character <= HANGUL_JONGSEONG_END)) || ((character >= HANGUL_SYLLABLE_START) && (character <= HANGUL_SYLLABLE_END))) {
HangulState state;
- HangulState initialState;
if (character < HANGUL_JUNGSEONG_START)
state = HangulStateL;
@@ -1768,8 +1767,6 @@ int RenderText::previousOffsetForBackwardDeletion(int current) const
else
state = isHangulLVT(character) ? HangulStateLVT : HangulStateLV;
- initialState = state;
-
while (current > 0 && ((character = text.characterStartingAt(current - 1)) >= HANGUL_CHOSEONG_START) && (character <= HANGUL_SYLLABLE_END) && ((character <= HANGUL_JONGSEONG_END) || (character >= HANGUL_SYLLABLE_START))) {
switch (state) {
case HangulStateV:
@@ -1801,7 +1798,7 @@ int RenderText::previousOffsetForBackwardDeletion(int current) const
return current;
#else
- // Platforms other than Mac delete by one code point.
+ // Platforms other than Mac or Linux delete by one code point.
if (U16_IS_TRAIL(m_text[--current]))
--current;
if (current < 0)
« no previous file with comments | « LayoutTests/platform/linux/editing/deleting/regional-indicators-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698