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

Side by Side Diff: third_party/WebKit/Source/core/editing/SelectionTemplate.cpp

Issue 2432173005: Get rid of VisibleSelection::selectionFromContentsOfNode() (Closed)
Patch Set: 2016-10-20T13:46:03 Created 4 years, 2 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 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/editing/SelectionTemplate.h" 5 #include "core/editing/SelectionTemplate.h"
6 6
7 #include "wtf/Assertions.h" 7 #include "wtf/Assertions.h"
8 #include <ostream> // NOLINT 8 #include <ostream> // NOLINT
9 9
10 namespace blink { 10 namespace blink {
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 DCHECK(position.isConnected()) << position; 178 DCHECK(position.isConnected()) << position;
179 DCHECK_EQ(m_selection.document(), position.document()); 179 DCHECK_EQ(m_selection.document(), position.document());
180 DCHECK(m_selection.base().isConnected()) << m_selection.base(); 180 DCHECK(m_selection.base().isConnected()) << m_selection.base();
181 DCHECK(m_selection.assertValid()); 181 DCHECK(m_selection.assertValid());
182 m_selection.m_extent = position; 182 m_selection.m_extent = position;
183 return *this; 183 return *this;
184 } 184 }
185 185
186 template <typename Strategy> 186 template <typename Strategy>
187 typename SelectionTemplate<Strategy>::Builder& 187 typename SelectionTemplate<Strategy>::Builder&
188 SelectionTemplate<Strategy>::Builder::selectAllChildren(const Node& node) {
189 return setBaseAndExtent(
190 EphemeralRangeTemplate<Strategy>::rangeOfContents(node));
191 }
192
193 template <typename Strategy>
194 typename SelectionTemplate<Strategy>::Builder&
188 SelectionTemplate<Strategy>::Builder::setAffinity(TextAffinity affinity) { 195 SelectionTemplate<Strategy>::Builder::setAffinity(TextAffinity affinity) {
189 m_selection.m_affinity = affinity; 196 m_selection.m_affinity = affinity;
190 return *this; 197 return *this;
191 } 198 }
192 199
193 template <typename Strategy> 200 template <typename Strategy>
194 typename SelectionTemplate<Strategy>::Builder& 201 typename SelectionTemplate<Strategy>::Builder&
195 SelectionTemplate<Strategy>::Builder::setBaseAndExtent( 202 SelectionTemplate<Strategy>::Builder::setBaseAndExtent(
196 const EphemeralRangeTemplate<Strategy>& range) { 203 const EphemeralRangeTemplate<Strategy>& range) {
197 if (range.isNull()) { 204 if (range.isNull()) {
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 SelectionTemplate<Strategy>::Builder::setIsDirectional(bool isDirectional) { 261 SelectionTemplate<Strategy>::Builder::setIsDirectional(bool isDirectional) {
255 m_selection.m_isDirectional = isDirectional; 262 m_selection.m_isDirectional = isDirectional;
256 return *this; 263 return *this;
257 } 264 }
258 265
259 template class CORE_TEMPLATE_EXPORT SelectionTemplate<EditingStrategy>; 266 template class CORE_TEMPLATE_EXPORT SelectionTemplate<EditingStrategy>;
260 template class CORE_TEMPLATE_EXPORT 267 template class CORE_TEMPLATE_EXPORT
261 SelectionTemplate<EditingInFlatTreeStrategy>; 268 SelectionTemplate<EditingInFlatTreeStrategy>;
262 269
263 } // namespace blink 270 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698