OLD | NEW |
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 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 // If a whitespace node had no renderer and goes through a recalcStyle it may | 286 // If a whitespace node had no renderer and goes through a recalcStyle it may |
287 // need to create one if the parent style now has white-space: pre. | 287 // need to create one if the parent style now has white-space: pre. |
288 bool Text::needsWhitespaceRenderer() | 288 bool Text::needsWhitespaceRenderer() |
289 { | 289 { |
290 ASSERT(!renderer()); | 290 ASSERT(!renderer()); |
291 if (RenderStyle* style = parentRenderStyle()) | 291 if (RenderStyle* style = parentRenderStyle()) |
292 return style->preserveNewline(); | 292 return style->preserveNewline(); |
293 return false; | 293 return false; |
294 } | 294 } |
295 | 295 |
296 void Text::updateTextRenderer(unsigned offsetOfReplacedData, unsigned lengthOfRe
placedData, AttachBehavior attachBehavior) | 296 void Text::updateTextRenderer(unsigned offsetOfReplacedData, unsigned lengthOfRe
placedData, RecalcStyleBehavior recalcStyleBehavior) |
297 { | 297 { |
298 if (!attached()) | 298 if (!attached()) |
299 return; | 299 return; |
300 RenderText* textRenderer = toRenderText(renderer()); | 300 RenderText* textRenderer = toRenderText(renderer()); |
301 if (!textRenderer || !textRendererIsNeeded(NodeRenderingContext(this, textRe
nderer->style()))) { | 301 if (!textRenderer || !textRendererIsNeeded(NodeRenderingContext(this, textRe
nderer->style()))) { |
302 if (attachBehavior == DeprecatedAttachNow) | 302 lazyReattach(); |
303 reattach(); | 303 // FIXME: Editing should be updated so this is not neccesary. |
304 else | 304 if (recalcStyleBehavior == DeprecatedRecalcStyleImmediatlelyForEditing) |
305 lazyReattach(); | 305 document().updateStyleIfNeeded(); |
306 return; | 306 return; |
307 } | 307 } |
308 textRenderer->setTextWithOffset(dataImpl(), offsetOfReplacedData, lengthOfRe
placedData); | 308 textRenderer->setTextWithOffset(dataImpl(), offsetOfReplacedData, lengthOfRe
placedData); |
309 } | 309 } |
310 | 310 |
311 bool Text::childTypeAllowed(NodeType) const | 311 bool Text::childTypeAllowed(NodeType) const |
312 { | 312 { |
313 return false; | 313 return false; |
314 } | 314 } |
315 | 315 |
(...skipping 29 matching lines...) Expand all Loading... |
345 result.appendLiteral("; "); | 345 result.appendLiteral("; "); |
346 result.appendLiteral("value="); | 346 result.appendLiteral("value="); |
347 result.append(s); | 347 result.append(s); |
348 } | 348 } |
349 | 349 |
350 strncpy(buffer, result.toString().utf8().data(), length - 1); | 350 strncpy(buffer, result.toString().utf8().data(), length - 1); |
351 } | 351 } |
352 #endif | 352 #endif |
353 | 353 |
354 } // namespace WebCore | 354 } // namespace WebCore |
OLD | NEW |