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

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

Issue 18276003: Avoid N^2 walk placing renderers when building the render tree (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Removing extra parens (whoops) Created 7 years, 5 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 | « Source/core/dom/Node.h ('k') | Source/core/dom/Text.cpp » ('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 a3ab8ce1826bf37261143e4304a5c70b3bf835ac..64eb17f3cc967313777ea551da09259b6140a1e7 100644
--- a/Source/core/dom/Node.cpp
+++ b/Source/core/dom/Node.cpp
@@ -1120,6 +1120,16 @@ void Node::detach(const AttachContext& context)
#endif
}
+void Node::reattachWhitespaceSiblings() const
+{
+ for (Node* sibling = nextSibling(); sibling; sibling = sibling->nextSibling()) {
+ if (sibling->renderer())
+ return;
+ if (sibling->isTextNode() && toText(sibling)->containsOnlyWhitespace())
+ sibling->reattach();
+ }
+}
+
// 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/Text.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698