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 r
ights reserved. | 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2013 Apple Inc. All r
ights 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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 document().incDOMTreeVersion(); | 180 document().incDOMTreeVersion(); |
181 didModifyData(oldData, source); | 181 didModifyData(oldData, source); |
182 } | 182 } |
183 | 183 |
184 void CharacterData::didModifyData(const String& oldData, UpdateSource source) | 184 void CharacterData::didModifyData(const String& oldData, UpdateSource source) |
185 { | 185 { |
186 if (MutationObserverInterestGroup* mutationRecipients = MutationObserverInte
restGroup::createForCharacterDataMutation(*this)) | 186 if (MutationObserverInterestGroup* mutationRecipients = MutationObserverInte
restGroup::createForCharacterDataMutation(*this)) |
187 mutationRecipients->enqueueMutationRecord(MutationRecord::createCharacte
rData(this, oldData)); | 187 mutationRecipients->enqueueMutationRecord(MutationRecord::createCharacte
rData(this, oldData)); |
188 | 188 |
189 if (parentNode()) { | 189 if (parentNode()) { |
190 ContainerNode::ChildrenChange change = {ContainerNode::TextChanged, prev
iousSibling(), nextSibling(), ContainerNode::ChildrenChangeSourceAPI}; | 190 ContainerNode::ChildrenChange change = {ContainerNode::TextChanged, this
, previousSibling(), nextSibling(), ContainerNode::ChildrenChangeSourceAPI}; |
191 parentNode()->childrenChanged(change); | 191 parentNode()->childrenChanged(change); |
192 } | 192 } |
193 | 193 |
194 // Skip DOM mutation events if the modification is from parser. | 194 // Skip DOM mutation events if the modification is from parser. |
195 // Note that mutation observer events will still fire. | 195 // Note that mutation observer events will still fire. |
196 // Spec: https://html.spec.whatwg.org/multipage/syntax.html#insert-a-charact
er | 196 // Spec: https://html.spec.whatwg.org/multipage/syntax.html#insert-a-charact
er |
197 if (source != UpdateFromParser && !isInShadowTree()) { | 197 if (source != UpdateFromParser && !isInShadowTree()) { |
198 if (document().hasListenerType(Document::DOMCHARACTERDATAMODIFIED_LISTEN
ER)) | 198 if (document().hasListenerType(Document::DOMCHARACTERDATAMODIFIED_LISTEN
ER)) |
199 dispatchScopedEvent(MutationEvent::create(EventTypeNames::DOMCharact
erDataModified, true, nullptr, oldData, m_data)); | 199 dispatchScopedEvent(MutationEvent::create(EventTypeNames::DOMCharact
erDataModified, true, nullptr, oldData, m_data)); |
200 dispatchSubtreeModifiedEvent(); | 200 dispatchSubtreeModifiedEvent(); |
201 } | 201 } |
202 InspectorInstrumentation::characterDataModified(this); | 202 InspectorInstrumentation::characterDataModified(this); |
203 } | 203 } |
204 | 204 |
205 int CharacterData::maxCharacterOffset() const | 205 int CharacterData::maxCharacterOffset() const |
206 { | 206 { |
207 return static_cast<int>(length()); | 207 return static_cast<int>(length()); |
208 } | 208 } |
209 | 209 |
210 } // namespace blink | 210 } // namespace blink |
OLD | NEW |