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

Unified Diff: Source/core/dom/Node.cpp

Issue 58373002: Whitespace only text nodes need to be reattached when their siblings are reattached (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixing reattach logic and killing WhitespaceChildList. Will probably need some updated mac expectat… Created 7 years, 1 month 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 | « Source/core/dom/Node.h ('k') | Source/core/dom/WhitespaceChildList.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Node.cpp
diff --git a/Source/core/dom/Node.cpp b/Source/core/dom/Node.cpp
index 89f80b54a0abb8e03fe2d50d433194f6fae29cd6..7a4f7c6541e0326fbcc40d639fe78bcb5de140f5 100644
--- a/Source/core/dom/Node.cpp
+++ b/Source/core/dom/Node.cpp
@@ -1003,6 +1003,16 @@ void Node::detach(const AttachContext& context)
#endif
}
+void Node::reattachWhitespaceSiblings() const
+{
+ for (Node* sibling = nextSibling(); sibling; sibling = sibling->nextSibling()) {
+ if (sibling->isTextNode() && toText(sibling)->containsOnlyWhitespace())
+ sibling->reattach();
leviw_travelin_and_unemployed 2013/11/04 23:43:09 The previous version wouldn't reattach whitespace
+ else if (sibling->renderer())
+ return;
+ }
+}
+
// FIXME: This code is used by editing. Seems like it could move over there and not pollute Node.
Node *Node::previousNodeConsideringAtomicNodes() const
{
« no previous file with comments | « Source/core/dom/Node.h ('k') | Source/core/dom/WhitespaceChildList.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698