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

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

Issue 2680463003: Remove branch on childNeedsDistributionRecalc (Closed)
Patch Set: Add updateDistribution to CharacterData::setDataAndUpdate, and its test Created 3 years, 10 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
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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 document().updateDistribution();
hayato 2017/02/07 07:46:24 This should be (this->)updateDistribution() (Node:
kojii 2017/02/07 08:44:33 Ah, thank you, done in PS3.
180
179 if (source != UpdateFromParser) 181 if (source != UpdateFromParser)
180 document().dataWillChange(*this); 182 document().dataWillChange(*this);
181 183
182 String oldData = m_data; 184 String oldData = m_data;
183 m_data = newData; 185 m_data = newData;
184 186
185 DCHECK(!layoutObject() || isTextNode()); 187 DCHECK(!layoutObject() || isTextNode());
186 if (isTextNode()) 188 if (isTextNode())
187 toText(this)->updateTextLayoutObject(offsetOfReplacedData, oldLength); 189 toText(this)->updateTextLayoutObject(offsetOfReplacedData, oldLength);
188 190
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 dispatchSubtreeModifiedEvent(); 224 dispatchSubtreeModifiedEvent();
223 } 225 }
224 InspectorInstrumentation::characterDataModified(this); 226 InspectorInstrumentation::characterDataModified(this);
225 } 227 }
226 228
227 int CharacterData::maxCharacterOffset() const { 229 int CharacterData::maxCharacterOffset() const {
228 return static_cast<int>(length()); 230 return static_cast<int>(length());
229 } 231 }
230 232
231 } // namespace blink 233 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698