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

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

Issue 24350009: Reverse style resolution to avoid N^2 walk when building the render tree (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixing loops in Regions Created 7 years, 3 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/dom/Node.cpp
diff --git a/Source/core/dom/Node.cpp b/Source/core/dom/Node.cpp
index 2c8d620ea48559f00c226405bcb8c5dade6e15c4..adc0f91e293ac28d33c3451023e2a865f72026b7 100644
--- a/Source/core/dom/Node.cpp
+++ b/Source/core/dom/Node.cpp
@@ -1030,6 +1030,20 @@ 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()) {
+ if (toText(sibling)->containsOnlyWhitespace())
+ sibling->reattach();
+ else
+ return;
+ }
+ }
+}
+
// FIXME: This code is used by editing. Seems like it could move over there and not pollute Node.
Node *Node::previousNodeConsideringAtomicNodes() const
{

Powered by Google App Engine
This is Rietveld 408576698