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

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

Issue 2644063002: Make SynchronousMutationObserver::didMergeTextNodes() to take both merged and merging nodes (Closed)
Patch Set: 2017-01-19T17:22:18 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
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.h ('k') | third_party/WebKit/Source/core/dom/DocumentTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/Document.cpp
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
index 5f1e6c6e1cac28260e164ab7704fe4efa8d79b14..9104d8ba9560ee56352de744498b8bbc3de3dc30 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -4267,16 +4267,18 @@ void Document::didRemoveText(Node* text, unsigned offset, unsigned length) {
m_markers->shiftMarkers(text, offset + length, 0 - length);
}
-void Document::didMergeTextNodes(Text& oldNode, unsigned offset) {
+void Document::didMergeTextNodes(const Text& mergedNode,
+ const Text& nodeToBeRemoved,
+ unsigned oldLength) {
+ NodeWithIndex nodeToBeRemovedWithIndex(const_cast<Text&>(nodeToBeRemoved));
if (!m_ranges.isEmpty()) {
- NodeWithIndex oldNodeWithIndex(oldNode);
for (Range* range : m_ranges)
- range->didMergeTextNodes(oldNodeWithIndex, offset);
+ range->didMergeTextNodes(nodeToBeRemovedWithIndex, oldLength);
}
- notifyMergeTextNodes(oldNode, offset);
+ notifyMergeTextNodes(mergedNode, nodeToBeRemovedWithIndex, oldLength);
if (m_frame)
- m_frame->selection().didMergeTextNodes(oldNode, offset);
+ m_frame->selection().didMergeTextNodes(nodeToBeRemoved, oldLength);
// FIXME: This should update markers for spelling and grammar checking.
}
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.h ('k') | third_party/WebKit/Source/core/dom/DocumentTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698