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

Unified Diff: Source/core/dom/Text.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.cpp ('k') | Source/core/dom/shadow/ShadowRoot.cpp » ('j') | 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 38631f0d7ad2b411af264d5d8832822284595150..792ce81248ea251b310423c147d6182860babadf 100644
--- a/Source/core/dom/Text.cpp
+++ b/Source/core/dom/Text.cpp
@@ -217,7 +217,9 @@ bool Text::textRendererIsNeeded(const NodeRenderingContext& context)
if (context.style()->preserveNewline()) // pre/pre-wrap/pre-line always make renderers.
return true;
-
+
+ // FIXME: We should resolve this function's dependencies on next and previous renderers
+ // lazily to avoid potentially N^2 walks through the DOM.
RenderObject* prev = context.previousRenderer();
if (prev && prev->isBR()) // <span><br/> <br/></span>
return false;
« no previous file with comments | « Source/core/dom/Node.cpp ('k') | Source/core/dom/shadow/ShadowRoot.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698