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 { |