| 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, 2013 Apple Inc. All | 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2013 Apple Inc. All |
| 5 * rights reserved. | 5 * rights 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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 | 169 |
| 170 void CharacterData::setNodeValue(const String& nodeValue) { | 170 void CharacterData::setNodeValue(const String& nodeValue) { |
| 171 setData(nodeValue); | 171 setData(nodeValue); |
| 172 } | 172 } |
| 173 | 173 |
| 174 void CharacterData::setDataAndUpdate(const String& newData, | 174 void CharacterData::setDataAndUpdate(const String& newData, |
| 175 unsigned offsetOfReplacedData, | 175 unsigned offsetOfReplacedData, |
| 176 unsigned oldLength, | 176 unsigned oldLength, |
| 177 unsigned newLength, | 177 unsigned newLength, |
| 178 UpdateSource source) { | 178 UpdateSource source) { |
| 179 if (source != UpdateFromParser) | |
| 180 document().dataWillChange(*this); | |
| 181 | |
| 182 String oldData = m_data; | 179 String oldData = m_data; |
| 183 m_data = newData; | 180 m_data = newData; |
| 184 | 181 |
| 185 DCHECK(!layoutObject() || isTextNode()); | 182 DCHECK(!layoutObject() || isTextNode()); |
| 186 if (isTextNode()) | 183 if (isTextNode()) |
| 187 toText(this)->updateTextLayoutObject(offsetOfReplacedData, oldLength); | 184 toText(this)->updateTextLayoutObject(offsetOfReplacedData, oldLength); |
| 188 | 185 |
| 189 if (source != UpdateFromParser) { | 186 if (source != UpdateFromParser) { |
| 190 if (getNodeType() == kProcessingInstructionNode) | 187 if (getNodeType() == kProcessingInstructionNode) |
| 191 toProcessingInstruction(this)->didAttributeChanged(); | 188 toProcessingInstruction(this)->didAttributeChanged(); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 222 dispatchSubtreeModifiedEvent(); | 219 dispatchSubtreeModifiedEvent(); |
| 223 } | 220 } |
| 224 InspectorInstrumentation::characterDataModified(this); | 221 InspectorInstrumentation::characterDataModified(this); |
| 225 } | 222 } |
| 226 | 223 |
| 227 int CharacterData::maxCharacterOffset() const { | 224 int CharacterData::maxCharacterOffset() const { |
| 228 return static_cast<int>(length()); | 225 return static_cast<int>(length()); |
| 229 } | 226 } |
| 230 | 227 |
| 231 } // namespace blink | 228 } // namespace blink |
| OLD | NEW |