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

Side by Side Diff: Source/core/editing/Position.cpp

Issue 1310433004: [Editing] Modify mostForward/BackwardCaretPosition naming confusion. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 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 | Source/core/editing/VisibleUnits.h » ('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, 2005, 2006, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2005, 2006, 2009 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 465 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 if (isNull()) 476 if (isNull())
477 return true; 477 return true;
478 // TODO(yosin) We should use |Strategy::lastOffsetForEditing()| instead of 478 // TODO(yosin) We should use |Strategy::lastOffsetForEditing()| instead of
479 // DOM tree version. 479 // DOM tree version.
480 return !Strategy::parent(*anchorNode()) && m_offset >= EditingStrategy::last OffsetForEditing(anchorNode()); 480 return !Strategy::parent(*anchorNode()) && m_offset >= EditingStrategy::last OffsetForEditing(anchorNode());
481 } 481 }
482 482
483 template <typename Strategy> 483 template <typename Strategy>
484 PositionAlgorithm<Strategy> PositionAlgorithm<Strategy>::upstream(EditingBoundar yCrossingRule rule) const 484 PositionAlgorithm<Strategy> PositionAlgorithm<Strategy>::upstream(EditingBoundar yCrossingRule rule) const
485 { 485 {
486 return mostForwardCaretPosition(*this, rule); 486 return mostBackwardCaretPosition(*this, rule);
487 } 487 }
488 488
489 template <typename Strategy> 489 template <typename Strategy>
490 PositionAlgorithm<Strategy> PositionAlgorithm<Strategy>::downstream(EditingBound aryCrossingRule rule) const 490 PositionAlgorithm<Strategy> PositionAlgorithm<Strategy>::downstream(EditingBound aryCrossingRule rule) const
491 { 491 {
492 return mostBackwardCaretPosition(*this, rule); 492 return mostForwardCaretPosition(*this, rule);
493 } 493 }
494 494
495 // TODO(yosin) We should move |isVisuallyEquivalentCandidate()| to 495 // TODO(yosin) We should move |isVisuallyEquivalentCandidate()| to
496 // "VisibleUnits.cpp" to reduce |LayoutObject| dependency in "Position.cpp". 496 // "VisibleUnits.cpp" to reduce |LayoutObject| dependency in "Position.cpp".
497 template <typename Strategy> 497 template <typename Strategy>
498 static bool isVisuallyEquivalentCandidateAlgorithm(const PositionAlgorithm<Strat egy>& position) 498 static bool isVisuallyEquivalentCandidateAlgorithm(const PositionAlgorithm<Strat egy>& position)
499 { 499 {
500 Node* const anchorNode = position.anchorNode(); 500 Node* const anchorNode = position.anchorNode();
501 if (!anchorNode) 501 if (!anchorNode)
502 return false; 502 return false;
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after
1025 1025
1026 void showTree(const blink::Position* pos) 1026 void showTree(const blink::Position* pos)
1027 { 1027 {
1028 if (pos) 1028 if (pos)
1029 pos->showTreeForThis(); 1029 pos->showTreeForThis();
1030 else 1030 else
1031 fprintf(stderr, "Cannot showTree for (nil)\n"); 1031 fprintf(stderr, "Cannot showTree for (nil)\n");
1032 } 1032 }
1033 1033
1034 #endif 1034 #endif
OLDNEW
« no previous file with comments | « no previous file | Source/core/editing/VisibleUnits.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698