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

Side by Side Diff: third_party/WebKit/Source/core/editing/Position.h

Issue 1997563002: Get rid of a redundant function alias positionBeforeNode() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2016-05-19T22:35:34 rebase Created 4 years, 7 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/editing/Position.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) 2004, 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2006, 2008 Apple 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 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 return PositionTemplate<Strategy>(Strategy::parent(node), Strategy::index(no de)); 246 return PositionTemplate<Strategy>(Strategy::parent(node), Strategy::index(no de));
247 } 247 }
248 248
249 template <typename Strategy> 249 template <typename Strategy>
250 PositionTemplate<Strategy> PositionTemplate<Strategy>::inParentAfterNode(const N ode& node) 250 PositionTemplate<Strategy> PositionTemplate<Strategy>::inParentAfterNode(const N ode& node)
251 { 251 {
252 DCHECK(node.parentNode()) << node; 252 DCHECK(node.parentNode()) << node;
253 return PositionTemplate<Strategy>(Strategy::parent(node), Strategy::index(no de) + 1); 253 return PositionTemplate<Strategy>(Strategy::parent(node), Strategy::index(no de) + 1);
254 } 254 }
255 255
256 // positionBeforeNode and Position::afterNode return neighbor-anchored positions , 256 // |Position::beforeNode()| and |Position::afterNode()| return neighbor-anchored
257 // construction is O(1) 257 // positions, construction is O(1)
258 template <typename Strategy> 258 template <typename Strategy>
259 PositionTemplate<Strategy> PositionTemplate<Strategy>::beforeNode(Node* anchorNo de) 259 PositionTemplate<Strategy> PositionTemplate<Strategy>::beforeNode(Node* anchorNo de)
260 { 260 {
261 DCHECK(anchorNode); 261 DCHECK(anchorNode);
262 return PositionTemplate<Strategy>(anchorNode, PositionAnchorType::BeforeAnch or); 262 return PositionTemplate<Strategy>(anchorNode, PositionAnchorType::BeforeAnch or);
263 } 263 }
264 264
265 inline Position positionBeforeNode(Node* anchorNode)
266 {
267 return Position::beforeNode(anchorNode);
268 }
269
270 template <typename Strategy> 265 template <typename Strategy>
271 PositionTemplate<Strategy> PositionTemplate<Strategy>::afterNode(Node* anchorNod e) 266 PositionTemplate<Strategy> PositionTemplate<Strategy>::afterNode(Node* anchorNod e)
272 { 267 {
273 DCHECK(anchorNode); 268 DCHECK(anchorNode);
274 return PositionTemplate<Strategy>(anchorNode, PositionAnchorType::AfterAncho r); 269 return PositionTemplate<Strategy>(anchorNode, PositionAnchorType::AfterAncho r);
275 } 270 }
276 271
277 template <typename Strategy> 272 template <typename Strategy>
278 int PositionTemplate<Strategy>::lastOffsetInNode(Node* node) 273 int PositionTemplate<Strategy>::lastOffsetInNode(Node* node)
279 { 274 {
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 345
351 } // namespace blink 346 } // namespace blink
352 347
353 #ifndef NDEBUG 348 #ifndef NDEBUG
354 // Outside the WebCore namespace for ease of invocation from gdb. 349 // Outside the WebCore namespace for ease of invocation from gdb.
355 void showTree(const blink::Position&); 350 void showTree(const blink::Position&);
356 void showTree(const blink::Position*); 351 void showTree(const blink::Position*);
357 #endif 352 #endif
358 353
359 #endif // Position_h 354 #endif // Position_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/Position.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698