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

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

Issue 24773003: Rename Node::attached() to confusingAndOftenMisusedAttached() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 2 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/StyleEngine.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 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 bool Text::needsWhitespaceRenderer() 325 bool Text::needsWhitespaceRenderer()
326 { 326 {
327 ASSERT(!renderer()); 327 ASSERT(!renderer());
328 if (RenderStyle* style = parentRenderStyle()) 328 if (RenderStyle* style = parentRenderStyle())
329 return style->preserveNewline(); 329 return style->preserveNewline();
330 return false; 330 return false;
331 } 331 }
332 332
333 void Text::updateTextRenderer(unsigned offsetOfReplacedData, unsigned lengthOfRe placedData, RecalcStyleBehavior recalcStyleBehavior) 333 void Text::updateTextRenderer(unsigned offsetOfReplacedData, unsigned lengthOfRe placedData, RecalcStyleBehavior recalcStyleBehavior)
334 { 334 {
335 if (!attached()) 335 if (!confusingAndOftenMisusedAttached())
336 return; 336 return;
337 RenderText* textRenderer = toRenderText(renderer()); 337 RenderText* textRenderer = toRenderText(renderer());
338 if (!textRenderer || !textRendererIsNeeded(NodeRenderingContext(this, textRe nderer->style()))) { 338 if (!textRenderer || !textRendererIsNeeded(NodeRenderingContext(this, textRe nderer->style()))) {
339 lazyReattach(); 339 lazyReattach();
340 // FIXME: Editing should be updated so this is not neccesary. 340 // FIXME: Editing should be updated so this is not neccesary.
341 if (recalcStyleBehavior == DeprecatedRecalcStyleImmediatlelyForEditing) 341 if (recalcStyleBehavior == DeprecatedRecalcStyleImmediatlelyForEditing)
342 document().updateStyleIfNeeded(); 342 document().updateStyleIfNeeded();
343 return; 343 return;
344 } 344 }
345 textRenderer->setTextWithOffset(dataImpl(), offsetOfReplacedData, lengthOfRe placedData); 345 textRenderer->setTextWithOffset(dataImpl(), offsetOfReplacedData, lengthOfRe placedData);
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 result.appendLiteral("; "); 382 result.appendLiteral("; ");
383 result.appendLiteral("value="); 383 result.appendLiteral("value=");
384 result.append(s); 384 result.append(s);
385 } 385 }
386 386
387 strncpy(buffer, result.toString().utf8().data(), length - 1); 387 strncpy(buffer, result.toString().utf8().data(), length - 1);
388 } 388 }
389 #endif 389 #endif
390 390
391 } // namespace WebCore 391 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/StyleEngine.cpp ('k') | Source/core/dom/shadow/ElementShadow.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698