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

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

Issue 1931513003: Invalidate the previous caret location when editing text nodes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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 a9ab5e34caaa358c846824a725e62aa88bc512f9..28890a0510e1d78ed67dd5923b93e0f21a1db75b 100644
--- a/third_party/WebKit/Source/core/dom/CharacterData.cpp
+++ b/third_party/WebKit/Source/core/dom/CharacterData.cpp
@@ -46,6 +46,8 @@ void CharacterData::setData(const String& data)
if (m_data == nonNullData)
return;
+ document().dataWillChange(*this);
+
unsigned oldLength = length();
setDataAndUpdate(nonNullData, 0, oldLength, nonNullData.length(), UpdateFromNonParser);
@@ -159,6 +161,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