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

Unified Diff: Source/core/editing/markup.cpp

Issue 44333002: Move innerHTML and outerHTML to Element (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased to latest master Created 7 years, 2 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: Source/core/editing/markup.cpp
diff --git a/Source/core/editing/markup.cpp b/Source/core/editing/markup.cpp
index 35f44dd4812903505005216ef265c9dcb7e39b39..293e68945158728032a3786b81845f68f9b3d04a 100644
--- a/Source/core/editing/markup.cpp
+++ b/Source/core/editing/markup.cpp
@@ -1073,4 +1073,18 @@ void replaceChildrenWithText(ContainerNode* container, const String& text, Excep
containerNode->appendChild(textNode.release(), es);
}
+void mergeWithNextTextNode(PassRefPtr<Node> node, ExceptionState& es)
+{
+ ASSERT(node && node->isTextNode());
+ Node* next = node->nextSibling();
+ if (!next || !next->isTextNode())
+ return;
+
+ RefPtr<Text> textNode = toText(node.get());
+ RefPtr<Text> textNext = toText(next);
+ textNode->appendData(textNext->data());
+ if (textNext->parentNode()) // Might have been removed by mutation event.
+ textNext->remove(es);
+}
+
}

Powered by Google App Engine
This is Rietveld 408576698