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

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

Issue 15159008: Node::lazyAttach shouldn't lie about being attached (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Missing commit Created 7 years, 7 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/Text.cpp
diff --git a/Source/core/dom/Text.cpp b/Source/core/dom/Text.cpp
index 75e42f8f92b635d8d6238efc7ddbbb4d4f0e151b..229a1d6963e670a25c68188b234704771179be9b 100644
--- a/Source/core/dom/Text.cpp
+++ b/Source/core/dom/Text.cpp
@@ -300,10 +300,13 @@ void Text::recalcTextStyle(StyleChange change)
void Text::updateTextRenderer(unsigned offsetOfReplacedData, unsigned lengthOfReplacedData)
{
- if (!attached())
+ if (!attached() && !needsStyleRecalc())
return;
RenderText* textRenderer = toRenderText(renderer());
if (!textRenderer || !textRendererIsNeeded(NodeRenderingContext(this, textRenderer->style()))) {
+ // FIXME: Editing code expects that inserting a text node will produce a renderer
+ // immediately so it can inspect the style of the text nodes. We should fix this
+ // so we can lazyReattach here.
reattach();
return;
}

Powered by Google App Engine
This is Rietveld 408576698