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 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 else if (renderer()) | 202 else if (renderer()) |
203 toRenderText(renderer())->setTextWithOffset(m_data.impl(), offsetOfRepla
cedData, lengthOfReplacedData); | 203 toRenderText(renderer())->setTextWithOffset(m_data.impl(), offsetOfRepla
cedData, lengthOfReplacedData); |
204 } | 204 } |
205 | 205 |
206 void CharacterData::dispatchModifiedEvent(const String& oldData) | 206 void CharacterData::dispatchModifiedEvent(const String& oldData) |
207 { | 207 { |
208 #if ENABLE(MUTATION_OBSERVERS) | 208 #if ENABLE(MUTATION_OBSERVERS) |
209 if (OwnPtr<MutationObserverInterestGroup> mutationRecipients = MutationObser
verInterestGroup::createForCharacterDataMutation(this)) | 209 if (OwnPtr<MutationObserverInterestGroup> mutationRecipients = MutationObser
verInterestGroup::createForCharacterDataMutation(this)) |
210 mutationRecipients->enqueueMutationRecord(MutationRecord::createCharacte
rData(this, oldData)); | 210 mutationRecipients->enqueueMutationRecord(MutationRecord::createCharacte
rData(this, oldData)); |
211 #endif | 211 #endif |
212 if (parentNode()) | 212 if (!isInShadowTree()) { |
213 parentNode()->childrenChanged(); | 213 if (parentNode()) |
214 if (document()->hasListenerType(Document::DOMCHARACTERDATAMODIFIED_LISTENER)
) | 214 parentNode()->childrenChanged(); |
215 dispatchScopedEvent(MutationEvent::create(eventNames().DOMCharacterDataM
odifiedEvent, true, 0, oldData, m_data)); | 215 if (document()->hasListenerType(Document::DOMCHARACTERDATAMODIFIED_LISTE
NER)) |
216 dispatchSubtreeModifiedEvent(); | 216 dispatchScopedEvent(MutationEvent::create(eventNames().DOMCharacterD
ataModifiedEvent, true, 0, oldData, m_data)); |
| 217 dispatchSubtreeModifiedEvent(); |
217 #if ENABLE(INSPECTOR) | 218 #if ENABLE(INSPECTOR) |
218 InspectorInstrumentation::characterDataModified(document(), this); | 219 InspectorInstrumentation::characterDataModified(document(), this); |
219 #endif | 220 #endif |
| 221 } |
220 } | 222 } |
221 | 223 |
222 void CharacterData::checkCharDataOperation(unsigned offset, ExceptionCode& ec) | 224 void CharacterData::checkCharDataOperation(unsigned offset, ExceptionCode& ec) |
223 { | 225 { |
224 ec = 0; | 226 ec = 0; |
225 | 227 |
226 // INDEX_SIZE_ERR: Raised if the specified offset is negative or greater tha
n the number of 16-bit | 228 // INDEX_SIZE_ERR: Raised if the specified offset is negative or greater tha
n the number of 16-bit |
227 // units in data. | 229 // units in data. |
228 if (offset > length()) { | 230 if (offset > length()) { |
229 ec = INDEX_SIZE_ERR; | 231 ec = INDEX_SIZE_ERR; |
(...skipping 12 matching lines...) Expand all Loading... |
242 return false; | 244 return false; |
243 return Node::rendererIsNeeded(context); | 245 return Node::rendererIsNeeded(context); |
244 } | 246 } |
245 | 247 |
246 bool CharacterData::offsetInCharacters() const | 248 bool CharacterData::offsetInCharacters() const |
247 { | 249 { |
248 return true; | 250 return true; |
249 } | 251 } |
250 | 252 |
251 } // namespace WebCore | 253 } // namespace WebCore |
OLD | NEW |