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

Side by Side 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: Rebase again 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/Node.cpp ('k') | Source/core/dom/shadow/ElementShadow.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 if (renderer) 287 if (renderer)
288 renderer->setText(dataImpl()); 288 renderer->setText(dataImpl());
289 else 289 else
290 reattach(); 290 reattach();
291 } 291 }
292 clearNeedsStyleRecalc(); 292 clearNeedsStyleRecalc();
293 } 293 }
294 294
295 void Text::updateTextRenderer(unsigned offsetOfReplacedData, unsigned lengthOfRe placedData) 295 void Text::updateTextRenderer(unsigned offsetOfReplacedData, unsigned lengthOfRe placedData)
296 { 296 {
297 if (!attached()) 297 if (!attached() && !needsStyleRecalc())
298 return; 298 return;
299 RenderText* textRenderer = toRenderText(renderer()); 299 RenderText* textRenderer = toRenderText(renderer());
300 if (!textRenderer || !textRendererIsNeeded(NodeRenderingContext(this, textRe nderer->style()))) { 300 if (!textRenderer || !textRendererIsNeeded(NodeRenderingContext(this, textRe nderer->style()))) {
301 // FIXME: Editing code expects that inserting a text node will produce a renderer
302 // immediately so it can inspect the style of the text nodes. We should fix this
303 // so we can lazyReattach here.
301 reattach(); 304 reattach();
302 return; 305 return;
303 } 306 }
304 textRenderer->setTextWithOffset(dataImpl(), offsetOfReplacedData, lengthOfRe placedData); 307 textRenderer->setTextWithOffset(dataImpl(), offsetOfReplacedData, lengthOfRe placedData);
305 } 308 }
306 309
307 bool Text::childTypeAllowed(NodeType) const 310 bool Text::childTypeAllowed(NodeType) const
308 { 311 {
309 return false; 312 return false;
310 } 313 }
(...skipping 30 matching lines...) Expand all
341 result.appendLiteral("; "); 344 result.appendLiteral("; ");
342 result.appendLiteral("value="); 345 result.appendLiteral("value=");
343 result.append(s); 346 result.append(s);
344 } 347 }
345 348
346 strncpy(buffer, result.toString().utf8().data(), length - 1); 349 strncpy(buffer, result.toString().utf8().data(), length - 1);
347 } 350 }
348 #endif 351 #endif
349 352
350 } // namespace WebCore 353 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/Node.cpp ('k') | Source/core/dom/shadow/ElementShadow.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698