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

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

Issue 2375383005: Prune CreateVisibleSelectionDeprecated from unit test files (Closed)
Patch Set: 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 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 VisibleSelection createVisibleSelection(const Position& pos, TextAffinity affini ty, bool isDirectional) 165 VisibleSelection createVisibleSelection(const Position& pos, TextAffinity affini ty, bool isDirectional)
166 { 166 {
167 DCHECK(!needsLayoutTreeUpdate(pos)); 167 DCHECK(!needsLayoutTreeUpdate(pos));
168 return VisibleSelection::create(pos, pos, affinity, isDirectional); 168 return VisibleSelection::create(pos, pos, affinity, isDirectional);
169 } 169 }
170 170
171 VisibleSelection createVisibleSelection(const Position& base, const Position& ex tent, TextAffinity affinity, bool isDirectional) 171 VisibleSelection createVisibleSelection(const Position& base, const Position& ex tent, TextAffinity affinity, bool isDirectional)
172 { 172 {
173 DCHECK(!needsLayoutTreeUpdate(base)); 173 DCHECK(!needsLayoutTreeUpdate(base));
174 DCHECK(!needsLayoutTreeUpdate(extent)); 174 DCHECK(!needsLayoutTreeUpdate(extent));
175 DCHECK(base.isNotNull() || extent.isNull());
175 return VisibleSelection::create(base, extent, affinity, isDirectional); 176 return VisibleSelection::create(base, extent, affinity, isDirectional);
176 } 177 }
177 178
178 VisibleSelection createVisibleSelection(const PositionWithAffinity& pos, bool is Directional) 179 VisibleSelection createVisibleSelection(const PositionWithAffinity& pos, bool is Directional)
179 { 180 {
180 DCHECK(!needsLayoutTreeUpdate(pos.position())); 181 DCHECK(!needsLayoutTreeUpdate(pos.position()));
181 return VisibleSelection::create(pos.position(), pos.position(), pos.affinity (), isDirectional); 182 return VisibleSelection::create(pos.position(), pos.position(), pos.affinity (), isDirectional);
182 } 183 }
183 184
184 VisibleSelection createVisibleSelection(const VisiblePosition& pos, bool isDirec tional) 185 VisibleSelection createVisibleSelection(const VisiblePosition& pos, bool isDirec tional)
185 { 186 {
186 DCHECK(pos.isValid()); 187 DCHECK(pos.isValid());
187 return VisibleSelection::create(pos.deepEquivalent(), pos.deepEquivalent(), pos.affinity(), isDirectional); 188 return VisibleSelection::create(pos.deepEquivalent(), pos.deepEquivalent(), pos.affinity(), isDirectional);
188 } 189 }
189 190
190 VisibleSelection createVisibleSelection(const VisiblePosition& base, const Visib lePosition& extent, bool isDirectional) 191 VisibleSelection createVisibleSelection(const VisiblePosition& base, const Visib lePosition& extent, bool isDirectional)
191 { 192 {
192 DCHECK(base.isValid()); 193 DCHECK(base.isValid());
193 DCHECK(extent.isValid()); 194 DCHECK(extent.isValid());
195 DCHECK(base.isNotNull() || extent.isNull());
194 return VisibleSelection::create(base.deepEquivalent(), extent.deepEquivalent (), base.affinity(), isDirectional); 196 return VisibleSelection::create(base.deepEquivalent(), extent.deepEquivalent (), base.affinity(), isDirectional);
195 } 197 }
196 198
197 VisibleSelection createVisibleSelection(const EphemeralRange& range, TextAffinit y affinity, bool isDirectional) 199 VisibleSelection createVisibleSelection(const EphemeralRange& range, TextAffinit y affinity, bool isDirectional)
198 { 200 {
199 DCHECK(!needsLayoutTreeUpdate(range.startPosition())); 201 DCHECK(!needsLayoutTreeUpdate(range.startPosition()));
200 DCHECK(!needsLayoutTreeUpdate(range.endPosition())); 202 DCHECK(!needsLayoutTreeUpdate(range.endPosition()));
201 return VisibleSelection::create(range.startPosition(), range.endPosition(), affinity, isDirectional); 203 return VisibleSelection::create(range.startPosition(), range.endPosition(), affinity, isDirectional);
202 } 204 }
203 205
204 VisibleSelectionInFlatTree createVisibleSelection(const PositionInFlatTree& pos, TextAffinity affinity, bool isDirectional) 206 VisibleSelectionInFlatTree createVisibleSelection(const PositionInFlatTree& pos, TextAffinity affinity, bool isDirectional)
205 { 207 {
206 DCHECK(!needsLayoutTreeUpdate(pos)); 208 DCHECK(!needsLayoutTreeUpdate(pos));
207 return VisibleSelectionInFlatTree::create(pos, pos, affinity, isDirectional) ; 209 return VisibleSelectionInFlatTree::create(pos, pos, affinity, isDirectional) ;
208 } 210 }
209 211
210 VisibleSelectionInFlatTree createVisibleSelection(const PositionInFlatTree& base , const PositionInFlatTree& extent, TextAffinity affinity, bool isDirectional) 212 VisibleSelectionInFlatTree createVisibleSelection(const PositionInFlatTree& base , const PositionInFlatTree& extent, TextAffinity affinity, bool isDirectional)
211 { 213 {
212 DCHECK(!needsLayoutTreeUpdate(base)); 214 DCHECK(!needsLayoutTreeUpdate(base));
213 DCHECK(!needsLayoutTreeUpdate(extent)); 215 DCHECK(!needsLayoutTreeUpdate(extent));
216 DCHECK(base.isNotNull() || extent.isNull());
214 return VisibleSelectionInFlatTree::create(base, extent, affinity, isDirectio nal); 217 return VisibleSelectionInFlatTree::create(base, extent, affinity, isDirectio nal);
215 } 218 }
216 219
217 VisibleSelectionInFlatTree createVisibleSelection(const PositionInFlatTreeWithAf finity& pos, bool isDirectional) 220 VisibleSelectionInFlatTree createVisibleSelection(const PositionInFlatTreeWithAf finity& pos, bool isDirectional)
218 { 221 {
219 DCHECK(!needsLayoutTreeUpdate(pos.position())); 222 DCHECK(!needsLayoutTreeUpdate(pos.position()));
220 return VisibleSelectionInFlatTree::create(pos.position(), pos.position(), po s.affinity(), isDirectional); 223 return VisibleSelectionInFlatTree::create(pos.position(), pos.position(), po s.affinity(), isDirectional);
221 } 224 }
222 225
223 VisibleSelectionInFlatTree createVisibleSelection(const VisiblePositionInFlatTre e& pos, bool isDirectional) 226 VisibleSelectionInFlatTree createVisibleSelection(const VisiblePositionInFlatTre e& pos, bool isDirectional)
224 { 227 {
225 DCHECK(pos.isValid()); 228 DCHECK(pos.isValid());
226 return VisibleSelectionInFlatTree::create(pos.deepEquivalent(), pos.deepEqui valent(), pos.affinity(), isDirectional); 229 return VisibleSelectionInFlatTree::create(pos.deepEquivalent(), pos.deepEqui valent(), pos.affinity(), isDirectional);
227 } 230 }
228 231
229 VisibleSelectionInFlatTree createVisibleSelection(const VisiblePositionInFlatTre e& base, const VisiblePositionInFlatTree& extent, bool isDirectional) 232 VisibleSelectionInFlatTree createVisibleSelection(const VisiblePositionInFlatTre e& base, const VisiblePositionInFlatTree& extent, bool isDirectional)
230 { 233 {
231 DCHECK(base.isValid()); 234 DCHECK(base.isValid());
232 DCHECK(extent.isValid()); 235 DCHECK(extent.isValid());
236 DCHECK(base.isNotNull() || extent.isNull());
233 return VisibleSelectionInFlatTree::create(base.deepEquivalent(), extent.deep Equivalent(), base.affinity(), isDirectional); 237 return VisibleSelectionInFlatTree::create(base.deepEquivalent(), extent.deep Equivalent(), base.affinity(), isDirectional);
234 } 238 }
235 239
236 VisibleSelectionInFlatTree createVisibleSelection(const EphemeralRangeInFlatTree & range, TextAffinity affinity, bool isDirectional) 240 VisibleSelectionInFlatTree createVisibleSelection(const EphemeralRangeInFlatTree & range, TextAffinity affinity, bool isDirectional)
237 { 241 {
238 DCHECK(!needsLayoutTreeUpdate(range.startPosition())); 242 DCHECK(!needsLayoutTreeUpdate(range.startPosition()));
239 DCHECK(!needsLayoutTreeUpdate(range.endPosition())); 243 DCHECK(!needsLayoutTreeUpdate(range.endPosition()));
240 return VisibleSelectionInFlatTree::create(range.startPosition(), range.endPo sition(), affinity, isDirectional); 244 return VisibleSelectionInFlatTree::create(range.startPosition(), range.endPo sition(), affinity, isDirectional);
241 } 245 }
242 246
(...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after
1001 { 1005 {
1002 sel.showTreeForThis(); 1006 sel.showTreeForThis();
1003 } 1007 }
1004 1008
1005 void showTree(const blink::VisibleSelectionInFlatTree* sel) 1009 void showTree(const blink::VisibleSelectionInFlatTree* sel)
1006 { 1010 {
1007 if (sel) 1011 if (sel)
1008 sel->showTreeForThis(); 1012 sel->showTreeForThis();
1009 } 1013 }
1010 #endif 1014 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698