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); |