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

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

Issue 1950473002: Invalidate the previous caret location when editing text nodes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: 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/dom/CharacterData.cpp
diff --git a/third_party/WebKit/Source/core/dom/CharacterData.cpp b/third_party/WebKit/Source/core/dom/CharacterData.cpp
index c8b125d85f6f5423a43ccdaad76db27d4119e748..01abf90fe28ca72961765f9ea877c22fa4537681 100644
--- a/third_party/WebKit/Source/core/dom/CharacterData.cpp
+++ b/third_party/WebKit/Source/core/dom/CharacterData.cpp
@@ -47,6 +47,7 @@ void CharacterData::setData(const String& data)
return;
RawPtr<CharacterData> protect(this);
+ document().dataWillChange(*this);
unsigned oldLength = length();
@@ -161,6 +162,9 @@ void CharacterData::setNodeValue(const String& nodeValue)
void CharacterData::setDataAndUpdate(const String& newData, unsigned offsetOfReplacedData, unsigned oldLength, unsigned newLength, UpdateSource source, RecalcStyleBehavior recalcStyleBehavior)
{
+ if (source != UpdateFromParser)
+ document().dataWillChange(*this);
+
String oldData = m_data;
m_data = newData;

Powered by Google App Engine
This is Rietveld 408576698