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

Unified Diff: Source/core/editing/VisibleUnits.h

Issue 1299323006: [Editing][CodeHealth] Move Position::up/downstream implementation to VisibleUnit.cpp (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/editing/Position.cpp ('k') | Source/core/editing/VisibleUnits.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/VisibleUnits.h
diff --git a/Source/core/editing/VisibleUnits.h b/Source/core/editing/VisibleUnits.h
index 3d010c5301a873cbfac3e3a5eaf8feae432ca97b..06546d62f20136cb4e69819d917b51ea4991ddff 100644
--- a/Source/core/editing/VisibleUnits.h
+++ b/Source/core/editing/VisibleUnits.h
@@ -43,6 +43,29 @@ class LocalFrame;
enum EWordSide { RightWordIfOnBoundary = false, LeftWordIfOnBoundary = true };
+// Position
+// mostForward/BackwardCaretPosition are used for moving back and forth between
+// visually equivalent candidates.
+// For example, for the text node "foo bar" where whitespace is
+// collapsible, there are two candidates that map to the VisiblePosition
+// between 'b' and the space, after first space and before last space.
+//
+// mostForwardCaretPosition returns the left candidate and also returs
+// [boundary, 0] for any of the positions from [boundary, 0] to the first
+// candidate in boundary, where
+// endsOfNodeAreVisuallyDistinctPositions(boundary) is true.
+//
+// mostBackwardCaretPosition() returns the right one and also returns the
+// last position in the last atomic node in boundary for all of the positions
+// in boundary after the last candidate, where
+// endsOfNodeAreVisuallyDistinctPositions(boundary).
+// FIXME: This function should never be called when the line box tree is dirty.
+// See https://bugs.webkit.org/show_bug.cgi?id=97264
+CORE_EXPORT Position mostForwardCaretPosition(const Position &, EditingBoundaryCrossingRule = CannotCrossEditingBoundary);
+CORE_EXPORT PositionInComposedTree mostForwardCaretPosition(const PositionInComposedTree &, EditingBoundaryCrossingRule = CannotCrossEditingBoundary);
+CORE_EXPORT Position mostBackwardCaretPosition(const Position &, EditingBoundaryCrossingRule = CannotCrossEditingBoundary);
+CORE_EXPORT PositionInComposedTree mostBackwardCaretPosition(const PositionInComposedTree &, EditingBoundaryCrossingRule = CannotCrossEditingBoundary);
+
// words
CORE_EXPORT VisiblePosition startOfWord(const VisiblePosition &, EWordSide = RightWordIfOnBoundary);
CORE_EXPORT VisiblePosition endOfWord(const VisiblePosition &, EWordSide = RightWordIfOnBoundary);
« no previous file with comments | « Source/core/editing/Position.cpp ('k') | Source/core/editing/VisibleUnits.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698