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

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

Issue 17054002: Element::recalcStyle() overly reattach()-es InsertionPoints. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: For landing Created 7 years, 6 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/NodeRenderingTraversal.cpp ('k') | Source/core/dom/shadow/ContentDistributor.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 9ace889c425cee2227e1365d5dcf7b5f3cc521f0..f5d58a3e4b49fcff564169ab0c902e1646887608 100644
--- a/Source/core/dom/Text.cpp
+++ b/Source/core/dom/Text.cpp
@@ -280,15 +280,20 @@ void Text::recalcTextStyle(StyleChange change)
{
RenderText* renderer = toRenderText(this->renderer());
- if (change != NoChange && renderer)
- renderer->setStyle(document()->styleResolver()->styleForText(this));
+ if (!renderer) {
+ if (needsStyleRecalc())
+ reattach();
+ clearNeedsStyleRecalc();
+ return;
+ }
if (needsStyleRecalc()) {
- if (renderer)
- renderer->setText(dataImpl());
- else
- reattach();
+ renderer->setStyle(document()->styleResolver()->styleForText(this));
+ renderer->setText(dataImpl());
+ } else if (change != NoChange) {
+ renderer->setStyle(document()->styleResolver()->styleForText(this));
}
+
clearNeedsStyleRecalc();
}
« no previous file with comments | « Source/core/dom/NodeRenderingTraversal.cpp ('k') | Source/core/dom/shadow/ContentDistributor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698