| 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 | 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights |
| 5 * reserved. | 5 * reserved. |
| 6 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 if (LayoutTextItem layoutItem = LayoutTextItem(this->layoutObject())) { | 397 if (LayoutTextItem layoutItem = LayoutTextItem(this->layoutObject())) { |
| 398 if (change != NoChange || needsStyleRecalc()) | 398 if (change != NoChange || needsStyleRecalc()) |
| 399 layoutItem.setStyle(document().ensureStyleResolver().styleForText(this)); | 399 layoutItem.setStyle(document().ensureStyleResolver().styleForText(this)); |
| 400 if (needsStyleRecalc()) | 400 if (needsStyleRecalc()) |
| 401 layoutItem.setText(dataImpl()); | 401 layoutItem.setText(dataImpl()); |
| 402 clearNeedsStyleRecalc(); | 402 clearNeedsStyleRecalc(); |
| 403 } else if (needsStyleRecalc() || needsWhitespaceLayoutObject()) { | 403 } else if (needsStyleRecalc() || needsWhitespaceLayoutObject()) { |
| 404 reattachLayoutTree(); | 404 reattachLayoutTree(); |
| 405 if (this->layoutObject()) | 405 if (this->layoutObject()) |
| 406 reattachWhitespaceSiblingsIfNeeded(nextTextSibling); | 406 reattachWhitespaceSiblingsIfNeeded(nextTextSibling); |
| 407 clearNeedsReattachLayoutTree(); |
| 407 } | 408 } |
| 408 } | 409 } |
| 409 | 410 |
| 410 // If a whitespace node had no layoutObject and goes through a recalcStyle it | 411 // If a whitespace node had no layoutObject and goes through a recalcStyle it |
| 411 // may need to create one if the parent style now has white-space: pre. | 412 // may need to create one if the parent style now has white-space: pre. |
| 412 bool Text::needsWhitespaceLayoutObject() { | 413 bool Text::needsWhitespaceLayoutObject() { |
| 413 DCHECK(!layoutObject()); | 414 DCHECK(!layoutObject()); |
| 414 if (const ComputedStyle* style = parentComputedStyle()) | 415 if (const ComputedStyle* style = parentComputedStyle()) |
| 415 return style->preserveNewline(); | 416 return style->preserveNewline(); |
| 416 return false; | 417 return false; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 | 450 |
| 450 Text* Text::cloneWithData(const String& data) { | 451 Text* Text::cloneWithData(const String& data) { |
| 451 return create(document(), data); | 452 return create(document(), data); |
| 452 } | 453 } |
| 453 | 454 |
| 454 DEFINE_TRACE(Text) { | 455 DEFINE_TRACE(Text) { |
| 455 CharacterData::trace(visitor); | 456 CharacterData::trace(visitor); |
| 456 } | 457 } |
| 457 | 458 |
| 458 } // namespace blink | 459 } // namespace blink |
| OLD | NEW |