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

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

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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed. 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed.
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 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 ContainerNode* highestRoot = highestEditableRoot(visiblePosition.deepEquival ent(), editableType); 272 ContainerNode* highestRoot = highestEditableRoot(visiblePosition.deepEquival ent(), editableType);
273 Node* previousNode = previousLeafWithSameEditability(node, editableType); 273 Node* previousNode = previousLeafWithSameEditability(node, editableType);
274 274
275 while (previousNode && (!previousNode->layoutObject() || inSameLine(createVi siblePosition(firstPositionInOrBeforeNode(previousNode)), visiblePosition))) 275 while (previousNode && (!previousNode->layoutObject() || inSameLine(createVi siblePosition(firstPositionInOrBeforeNode(previousNode)), visiblePosition)))
276 previousNode = previousLeafWithSameEditability(previousNode, editableTyp e); 276 previousNode = previousLeafWithSameEditability(previousNode, editableTyp e);
277 277
278 while (previousNode && !previousNode->isShadowRoot()) { 278 while (previousNode && !previousNode->isShadowRoot()) {
279 if (highestEditableRoot(firstPositionInOrBeforeNode(previousNode), edita bleType) != highestRoot) 279 if (highestEditableRoot(firstPositionInOrBeforeNode(previousNode), edita bleType) != highestRoot)
280 break; 280 break;
281 281
282 Position pos = isHTMLBRElement(*previousNode) ? positionBeforeNode(previ ousNode) : 282 Position pos = isHTMLBRElement(*previousNode) ? Position::beforeNode(pre viousNode) :
283 Position::editingPositionOf(previousNode, caretMaxOffset(previousNod e)); 283 Position::editingPositionOf(previousNode, caretMaxOffset(previousNod e));
284 284
285 if (isVisuallyEquivalentCandidate(pos)) 285 if (isVisuallyEquivalentCandidate(pos))
286 return pos; 286 return pos;
287 287
288 previousNode = previousLeafWithSameEditability(previousNode, editableTyp e); 288 previousNode = previousLeafWithSameEditability(previousNode, editableTyp e);
289 } 289 }
290 return Position(); 290 return Position();
291 } 291 }
292 292
(...skipping 2958 matching lines...) Expand 10 before | Expand all | Expand 10 after
3251 { 3251 {
3252 return previousPositionOfAlgorithm<EditingStrategy>(visiblePosition, rule); 3252 return previousPositionOfAlgorithm<EditingStrategy>(visiblePosition, rule);
3253 } 3253 }
3254 3254
3255 VisiblePositionInFlatTree previousPositionOf(const VisiblePositionInFlatTree& vi siblePosition, EditingBoundaryCrossingRule rule) 3255 VisiblePositionInFlatTree previousPositionOf(const VisiblePositionInFlatTree& vi siblePosition, EditingBoundaryCrossingRule rule)
3256 { 3256 {
3257 return previousPositionOfAlgorithm<EditingInFlatTreeStrategy>(visiblePositio n, rule); 3257 return previousPositionOfAlgorithm<EditingInFlatTreeStrategy>(visiblePositio n, rule);
3258 } 3258 }
3259 3259
3260 } // namespace blink 3260 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698