| 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 continue; | 75 continue; |
| 76 } | 76 } |
| 77 | 77 |
| 78 // Both non-empty text nodes. Merge them. | 78 // Both non-empty text nodes. Merge them. |
| 79 unsigned offset = length(); | 79 unsigned offset = length(); |
| 80 String nextTextData = nextText->data(); | 80 String nextTextData = nextText->data(); |
| 81 String oldTextData = data(); | 81 String oldTextData = data(); |
| 82 setDataWithoutUpdate(data() + nextTextData); | 82 setDataWithoutUpdate(data() + nextTextData); |
| 83 updateTextLayoutObject(oldTextData.length(), 0); | 83 updateTextLayoutObject(oldTextData.length(), 0); |
| 84 | 84 |
| 85 document().didMergeTextNodes(*this, *nextText, offset); |
| 86 |
| 85 // Empty nextText for layout update. | 87 // Empty nextText for layout update. |
| 86 nextText->setDataWithoutUpdate(emptyString()); | 88 nextText->setDataWithoutUpdate(emptyString()); |
| 87 nextText->updateTextLayoutObject(0, nextTextData.length()); | 89 nextText->updateTextLayoutObject(0, nextTextData.length()); |
| 88 | 90 |
| 89 document().didMergeTextNodes(*nextText, offset); | |
| 90 | |
| 91 // Restore nextText for mutation event. | 91 // Restore nextText for mutation event. |
| 92 nextText->setDataWithoutUpdate(nextTextData); | 92 nextText->setDataWithoutUpdate(nextTextData); |
| 93 nextText->updateTextLayoutObject(0, 0); | 93 nextText->updateTextLayoutObject(0, 0); |
| 94 | 94 |
| 95 document().incDOMTreeVersion(); | 95 document().incDOMTreeVersion(); |
| 96 didModifyData(oldTextData, CharacterData::UpdateFromNonParser); | 96 didModifyData(oldTextData, CharacterData::UpdateFromNonParser); |
| 97 nextText->remove(IGNORE_EXCEPTION_FOR_TESTING); | 97 nextText->remove(IGNORE_EXCEPTION_FOR_TESTING); |
| 98 } | 98 } |
| 99 | 99 |
| 100 return NodeTraversal::nextPostOrder(*this); | 100 return NodeTraversal::nextPostOrder(*this); |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 | 449 |
| 450 Text* Text::cloneWithData(const String& data) { | 450 Text* Text::cloneWithData(const String& data) { |
| 451 return create(document(), data); | 451 return create(document(), data); |
| 452 } | 452 } |
| 453 | 453 |
| 454 DEFINE_TRACE(Text) { | 454 DEFINE_TRACE(Text) { |
| 455 CharacterData::trace(visitor); | 455 CharacterData::trace(visitor); |
| 456 } | 456 } |
| 457 | 457 |
| 458 } // namespace blink | 458 } // namespace blink |
| OLD | NEW |