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

Side by Side Diff: trunk/Source/core/dom/Text.cpp

Issue 16336010: Revert 150924 "Node::lazyAttach shouldn't lie about being attached" (Closed) Base URL: svn://svn.chromium.org/blink/
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « trunk/Source/core/dom/Node.cpp ('k') | trunk/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() && !needsStyleRecalc()) 297 if (!attached())
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.
304 reattach(); 301 reattach();
305 return; 302 return;
306 } 303 }
307 textRenderer->setTextWithOffset(dataImpl(), offsetOfReplacedData, lengthOfRe placedData); 304 textRenderer->setTextWithOffset(dataImpl(), offsetOfReplacedData, lengthOfRe placedData);
308 } 305 }
309 306
310 bool Text::childTypeAllowed(NodeType) const 307 bool Text::childTypeAllowed(NodeType) const
311 { 308 {
312 return false; 309 return false;
313 } 310 }
(...skipping 30 matching lines...) Expand all
344 result.appendLiteral("; "); 341 result.appendLiteral("; ");
345 result.appendLiteral("value="); 342 result.appendLiteral("value=");
346 result.append(s); 343 result.append(s);
347 } 344 }
348 345
349 strncpy(buffer, result.toString().utf8().data(), length - 1); 346 strncpy(buffer, result.toString().utf8().data(), length - 1);
350 } 347 }
351 #endif 348 #endif
352 349
353 } // namespace WebCore 350 } // namespace WebCore
OLDNEW
« no previous file with comments | « trunk/Source/core/dom/Node.cpp ('k') | trunk/Source/core/dom/shadow/ElementShadow.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698