| 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 26 matching lines...) Expand all Loading... |
| 37 using namespace std; | 37 using namespace std; |
| 38 | 38 |
| 39 namespace WebCore { | 39 namespace WebCore { |
| 40 | 40 |
| 41 void CharacterData::setData(const String& data, ExceptionCode&) | 41 void CharacterData::setData(const String& data, ExceptionCode&) |
| 42 { | 42 { |
| 43 const String& nonNullData = !data.isNull() ? data : emptyString(); | 43 const String& nonNullData = !data.isNull() ? data : emptyString(); |
| 44 if (m_data == nonNullData) | 44 if (m_data == nonNullData) |
| 45 return; | 45 return; |
| 46 | 46 |
| 47 RefPtr<CharacterData> protect = this; |
| 48 |
| 47 unsigned oldLength = length(); | 49 unsigned oldLength = length(); |
| 48 | 50 |
| 49 setDataAndUpdate(nonNullData, 0, oldLength, nonNullData.length()); | 51 setDataAndUpdate(nonNullData, 0, oldLength, nonNullData.length()); |
| 50 document()->textRemoved(this, 0, oldLength); | 52 document()->textRemoved(this, 0, oldLength); |
| 51 } | 53 } |
| 52 | 54 |
| 53 String CharacterData::substringData(unsigned offset, unsigned count, ExceptionCo
de& ec) | 55 String CharacterData::substringData(unsigned offset, unsigned count, ExceptionCo
de& ec) |
| 54 { | 56 { |
| 55 checkCharDataOperation(offset, ec); | 57 checkCharDataOperation(offset, ec); |
| 56 if (ec) | 58 if (ec) |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 return false; | 232 return false; |
| 231 return Node::rendererIsNeeded(context); | 233 return Node::rendererIsNeeded(context); |
| 232 } | 234 } |
| 233 | 235 |
| 234 bool CharacterData::offsetInCharacters() const | 236 bool CharacterData::offsetInCharacters() const |
| 235 { | 237 { |
| 236 return true; | 238 return true; |
| 237 } | 239 } |
| 238 | 240 |
| 239 } // namespace WebCore | 241 } // namespace WebCore |
| OLD | NEW |