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

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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/Document.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..1f0cbf6b96c5a96dcebce6d7cb4be3595da423ed 100644
--- a/third_party/WebKit/Source/core/dom/CharacterData.cpp
+++ b/third_party/WebKit/Source/core/dom/CharacterData.cpp
@@ -42,6 +42,8 @@ void CharacterData::atomize()
void CharacterData::setData(const String& data)
{
+ document().dataWillChange(*this);
yosin_UTC9 2016/04/28 01:50:28 At glance, calling |dataWillChange()| is enough in
chrishtr 2016/04/28 17:22:01 setData() is an indepenent call site, no?
+
const String& nonNullData = !data.isNull() ? data : emptyString();
if (m_data == nonNullData)
return;
@@ -159,6 +161,8 @@ void CharacterData::setNodeValue(const String& nodeValue)
void CharacterData::setDataAndUpdate(const String& newData, unsigned offsetOfReplacedData, unsigned oldLength, unsigned newLength, UpdateSource source, RecalcStyleBehavior recalcStyleBehavior)
{
+ document().dataWillChange(*this);
yosin_UTC9 2016/04/28 01:50:28 Should we call this for |source != UpdateFromParse
chrishtr 2016/04/28 17:22:02 Done.
+
String oldData = m_data;
m_data = newData;
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/Document.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698