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 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 if (renderer) | 293 if (renderer) |
294 renderer->setText(dataImpl()); | 294 renderer->setText(dataImpl()); |
295 else | 295 else |
296 reattach(); | 296 reattach(); |
297 } | 297 } |
298 clearNeedsStyleRecalc(); | 298 clearNeedsStyleRecalc(); |
299 } | 299 } |
300 | 300 |
301 void Text::updateTextRenderer(unsigned offsetOfReplacedData, unsigned lengthOfRe
placedData) | 301 void Text::updateTextRenderer(unsigned offsetOfReplacedData, unsigned lengthOfRe
placedData) |
302 { | 302 { |
303 if (!attached()) | 303 if (!attached() && !needsStyleRecalc()) |
304 return; | 304 return; |
305 RenderText* textRenderer = toRenderText(renderer()); | 305 RenderText* textRenderer = toRenderText(renderer()); |
306 if (!textRenderer || !textRendererIsNeeded(NodeRenderingContext(this, textRe
nderer->style()))) { | 306 if (!textRenderer || !textRendererIsNeeded(NodeRenderingContext(this, textRe
nderer->style()))) { |
| 307 // FIXME: Editing code expects that inserting a text node will produce a
renderer |
| 308 // immediately so it can inspect the style of the text nodes. We should
fix this |
| 309 // so we can lazyReattach here. |
307 reattach(); | 310 reattach(); |
308 return; | 311 return; |
309 } | 312 } |
310 textRenderer->setTextWithOffset(dataImpl(), offsetOfReplacedData, lengthOfRe
placedData); | 313 textRenderer->setTextWithOffset(dataImpl(), offsetOfReplacedData, lengthOfRe
placedData); |
311 } | 314 } |
312 | 315 |
313 bool Text::childTypeAllowed(NodeType) const | 316 bool Text::childTypeAllowed(NodeType) const |
314 { | 317 { |
315 return false; | 318 return false; |
316 } | 319 } |
(...skipping 30 matching lines...) Expand all Loading... |
347 result.appendLiteral("; "); | 350 result.appendLiteral("; "); |
348 result.appendLiteral("value="); | 351 result.appendLiteral("value="); |
349 result.append(s); | 352 result.append(s); |
350 } | 353 } |
351 | 354 |
352 strncpy(buffer, result.toString().utf8().data(), length - 1); | 355 strncpy(buffer, result.toString().utf8().data(), length - 1); |
353 } | 356 } |
354 #endif | 357 #endif |
355 | 358 |
356 } // namespace WebCore | 359 } // namespace WebCore |
OLD | NEW |