Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(241)

Side by Side Diff: third_party/WebKit/Source/core/dom/CharacterData.cpp

Issue 2638423005: Make FrameSelection to utilize SynchronousMutationObserver (Closed)
Patch Set: 2017-01-20T19:16:11 Rebase Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/Document.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 DCHECK(!layoutObject() || isTextNode()); 185 DCHECK(!layoutObject() || isTextNode());
186 if (isTextNode()) 186 if (isTextNode())
187 toText(this)->updateTextLayoutObject(offsetOfReplacedData, oldLength); 187 toText(this)->updateTextLayoutObject(offsetOfReplacedData, oldLength);
188 188
189 if (source != UpdateFromParser) { 189 if (source != UpdateFromParser) {
190 if (getNodeType() == kProcessingInstructionNode) 190 if (getNodeType() == kProcessingInstructionNode)
191 toProcessingInstruction(this)->didAttributeChanged(); 191 toProcessingInstruction(this)->didAttributeChanged();
192 192
193 document().notifyUpdateCharacterData(this, offsetOfReplacedData, oldLength, 193 document().notifyUpdateCharacterData(this, offsetOfReplacedData, oldLength,
194 newLength); 194 newLength);
195
196 if (document().frame())
197 document().frame()->selection().didUpdateCharacterData(
198 this, offsetOfReplacedData, oldLength, newLength);
199 } 195 }
200 196
201 document().incDOMTreeVersion(); 197 document().incDOMTreeVersion();
202 didModifyData(oldData, source); 198 didModifyData(oldData, source);
203 } 199 }
204 200
205 void CharacterData::didModifyData(const String& oldData, UpdateSource source) { 201 void CharacterData::didModifyData(const String& oldData, UpdateSource source) {
206 if (MutationObserverInterestGroup* mutationRecipients = 202 if (MutationObserverInterestGroup* mutationRecipients =
207 MutationObserverInterestGroup::createForCharacterDataMutation(*this)) 203 MutationObserverInterestGroup::createForCharacterDataMutation(*this))
208 mutationRecipients->enqueueMutationRecord( 204 mutationRecipients->enqueueMutationRecord(
(...skipping 17 matching lines...) Expand all
226 dispatchSubtreeModifiedEvent(); 222 dispatchSubtreeModifiedEvent();
227 } 223 }
228 InspectorInstrumentation::characterDataModified(this); 224 InspectorInstrumentation::characterDataModified(this);
229 } 225 }
230 226
231 int CharacterData::maxCharacterOffset() const { 227 int CharacterData::maxCharacterOffset() const {
232 return static_cast<int>(length()); 228 return static_cast<int>(length());
233 } 229 }
234 230
235 } // namespace blink 231 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/Document.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698