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

Unified Diff: third_party/WebKit/Source/core/dom/CharacterData.cpp

Issue 2650113004: [WIP] Add support for Android SuggestionSpans when editing text (Closed)
Patch Set: Remove logging statements, fix copyright years in new files Created 3 years, 11 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/dom/CharacterData.cpp
diff --git a/third_party/WebKit/Source/core/dom/CharacterData.cpp b/third_party/WebKit/Source/core/dom/CharacterData.cpp
index 6605cf0cdcaffbe291a42eb3b2a1d79e8ff1868b..1a50c4898bc46a7d94375c88509d5588659dff3d 100644
--- a/third_party/WebKit/Source/core/dom/CharacterData.cpp
+++ b/third_party/WebKit/Source/core/dom/CharacterData.cpp
@@ -154,9 +154,11 @@ void CharacterData::replaceData(unsigned offset,
setDataAndUpdate(newStr, offset, realCount, data.length(),
UpdateFromNonParser);
- // update the markers for spell checking and grammar checking
- document().didRemoveText(this, offset, realCount);
+ // Update the markers for spell checking, grammar checking, and text
+ // suggestions. didInsertText() must be called first so suggestion markers
+ // properly track text replacments.
document().didInsertText(this, offset, data.length());
+ document().didRemoveText(this, offset + data.length(), realCount);
rlanday 2017/01/31 19:50:21 I hope this doesn't break anything...presumably we
esprehn 2017/01/31 22:41:34 This probably needs unit tests?
}
String CharacterData::nodeValue() const {

Powered by Google App Engine
This is Rietveld 408576698