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

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

Issue 845453006: Add ASSERT childNeedsDistributionRecalc in ComposedTreeTraversal (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix for fast\images\element-gcd-while-generating-alt-content.html Created 5 years, 11 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 | « no previous file | Source/core/dom/shadow/ComposedTreeTraversal.h » ('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 1f155bc5926b1a4639bc1113bae1caf95dda2dcb..782e058b4871983231619023ff9cd21da213eda6 100644
--- a/Source/core/dom/Text.cpp
+++ b/Source/core/dom/Text.cpp
@@ -277,6 +277,10 @@ bool Text::textRendererIsNeeded(const RenderStyle& style, const RenderObject& pa
if (style.preserveNewline()) // pre/pre-wrap/pre-line always make renderers.
return true;
+ // childNeedsDistributionRecalc() here is rare, only happens JS calling surroundContents() etc. from DOMNodeInsertedIntoDocument etc.
+ if (document().childNeedsDistributionRecalc())
hayato 2015/01/23 04:06:30 Could you help me to understand why it is okay to
kojii 2015/01/23 04:23:13 In short, this fix disables a non-essential memory
+ return true;
+
const RenderObject* prev = NodeRenderingTraversal::previousSiblingRenderer(*this);
if (prev && prev->isBR()) // <span><br/> <br/></span>
return false;
« no previous file with comments | « no previous file | Source/core/dom/shadow/ComposedTreeTraversal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698