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 11 matching lines...) Expand all Loading... |
22 #include "config.h" | 22 #include "config.h" |
23 #include "core/dom/CharacterData.h" | 23 #include "core/dom/CharacterData.h" |
24 | 24 |
25 #include "bindings/v8/ExceptionState.h" | 25 #include "bindings/v8/ExceptionState.h" |
26 #include "core/dom/Document.h" | 26 #include "core/dom/Document.h" |
27 #include "core/dom/EventNames.h" | 27 #include "core/dom/EventNames.h" |
28 #include "core/dom/ExceptionCode.h" | 28 #include "core/dom/ExceptionCode.h" |
29 #include "core/dom/MutationEvent.h" | 29 #include "core/dom/MutationEvent.h" |
30 #include "core/dom/MutationObserverInterestGroup.h" | 30 #include "core/dom/MutationObserverInterestGroup.h" |
31 #include "core/dom/MutationRecord.h" | 31 #include "core/dom/MutationRecord.h" |
| 32 #include "core/dom/ProcessingInstruction.h" |
32 #include "core/dom/Text.h" | 33 #include "core/dom/Text.h" |
33 #include "core/editing/FrameSelection.h" | 34 #include "core/editing/FrameSelection.h" |
34 #include "core/inspector/InspectorInstrumentation.h" | 35 #include "core/inspector/InspectorInstrumentation.h" |
35 #include "core/platform/text/TextBreakIterator.h" | 36 #include "core/platform/text/TextBreakIterator.h" |
36 | 37 |
37 using namespace std; | 38 using namespace std; |
38 | 39 |
39 namespace WebCore { | 40 namespace WebCore { |
40 | 41 |
41 void CharacterData::atomize() | 42 void CharacterData::atomize() |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 | 194 |
194 void CharacterData::setDataAndUpdate(const String& newData, unsigned offsetOfRep
lacedData, unsigned oldLength, unsigned newLength) | 195 void CharacterData::setDataAndUpdate(const String& newData, unsigned offsetOfRep
lacedData, unsigned oldLength, unsigned newLength) |
195 { | 196 { |
196 String oldData = m_data; | 197 String oldData = m_data; |
197 m_data = newData; | 198 m_data = newData; |
198 | 199 |
199 ASSERT(!renderer() || isTextNode()); | 200 ASSERT(!renderer() || isTextNode()); |
200 if (isTextNode()) | 201 if (isTextNode()) |
201 toText(this)->updateTextRenderer(offsetOfReplacedData, oldLength); | 202 toText(this)->updateTextRenderer(offsetOfReplacedData, oldLength); |
202 | 203 |
| 204 if (nodeType() == PROCESSING_INSTRUCTION_NODE) |
| 205 toProcessingInstruction(this)->checkStyleSheet(); |
| 206 |
203 if (document()->frame()) | 207 if (document()->frame()) |
204 document()->frame()->selection()->textWasReplaced(this, offsetOfReplaced
Data, oldLength, newLength); | 208 document()->frame()->selection()->textWasReplaced(this, offsetOfReplaced
Data, oldLength, newLength); |
205 | 209 |
206 document()->incDOMTreeVersion(); | 210 document()->incDOMTreeVersion(); |
207 didModifyData(oldData); | 211 didModifyData(oldData); |
208 } | 212 } |
209 | 213 |
210 void CharacterData::didModifyData(const String& oldData) | 214 void CharacterData::didModifyData(const String& oldData) |
211 { | 215 { |
212 if (OwnPtr<MutationObserverInterestGroup> mutationRecipients = MutationObser
verInterestGroup::createForCharacterDataMutation(this)) | 216 if (OwnPtr<MutationObserverInterestGroup> mutationRecipients = MutationObser
verInterestGroup::createForCharacterDataMutation(this)) |
(...skipping 14 matching lines...) Expand all Loading... |
227 { | 231 { |
228 return static_cast<int>(length()); | 232 return static_cast<int>(length()); |
229 } | 233 } |
230 | 234 |
231 bool CharacterData::offsetInCharacters() const | 235 bool CharacterData::offsetInCharacters() const |
232 { | 236 { |
233 return true; | 237 return true; |
234 } | 238 } |
235 | 239 |
236 } // namespace WebCore | 240 } // namespace WebCore |
OLD | NEW |