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

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

Issue 684633006: Reattach whitespace siblings only when needed (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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
« Source/core/dom/Node.cpp ('K') | « Source/core/dom/Node.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Text.cpp
diff --git a/Source/core/dom/Text.cpp b/Source/core/dom/Text.cpp
index 2426009c6edb92702b679096b4140bc7abb6aa20..5cc1871fe6b8d5b708c225df3a4a3bfcade1cc17 100644
--- a/Source/core/dom/Text.cpp
+++ b/Source/core/dom/Text.cpp
@@ -274,7 +274,7 @@ bool Text::textRendererIsNeeded(const RenderStyle& style, const RenderObject& pa
unsigned maxSiblingsToVisit = 50;
RenderObject* first = parent.slowFirstChild();
- while (first && first->isFloatingOrOutOfFlowPositioned() && maxSiblingsToVisit--)
+ while (first && (first == renderer() || first->isFloatingOrOutOfFlowPositioned()) && maxSiblingsToVisit--)
esprehn 2014/11/04 22:03:55 renderer() has a branch inside it, you shouldn't c
first = first->nextSibling();
if (!first || NodeRenderingTraversal::nextSiblingRenderer(this) == first)
// Whitespace at the start of a block just goes away. Don't even
@@ -319,7 +319,7 @@ void Text::recalcTextStyle(StyleRecalcChange change, Text* nextTextSibling)
} else if (needsStyleRecalc() || needsWhitespaceRenderer()) {
reattach();
if (this->renderer())
- reattachWhitespaceSiblings(nextTextSibling);
+ reattachWhitespaceSiblingsIfNeeded(nextTextSibling);
}
}
« Source/core/dom/Node.cpp ('K') | « Source/core/dom/Node.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698