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

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

Issue 1310533002: Move {next,previous}PositionOf() to EditingUtilities.{cpp,h} from Position.{cpp,h} (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-22T09:42:03 Rebase 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 | « no previous file | Source/core/editing/EditingUtilities.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/EditingUtilities.h
diff --git a/Source/core/editing/EditingUtilities.h b/Source/core/editing/EditingUtilities.h
index 56009402f6bf37b9c5b7ff1492e8cc0792c82454..8a597ea318081c3d9204ef6fd28b8daede631a8b 100644
--- a/Source/core/editing/EditingUtilities.h
+++ b/Source/core/editing/EditingUtilities.h
@@ -36,6 +36,12 @@
namespace blink {
+enum class PositionMoveType {
+ CodePoint, // Move by a single code point.
+ Character, // Move to the next Unicode character break.
+ BackwardDeletion // Subject to platform conventions.
+};
+
class Document;
class Element;
class HTMLBRElement;
@@ -48,7 +54,6 @@ class Range;
class VisiblePosition;
class VisibleSelection;
-
// This file contains a set of helper functions used by the editing commands
// -------------------------------------------------------------------------
@@ -177,6 +182,18 @@ inline Position lastPositionInOrAfterNode(Node* node)
Position lastEditablePositionBeforePositionInRoot(const Position&, Node*);
PositionInComposedTree lastEditablePositionBeforePositionInRoot(const PositionInComposedTree&, Node*);
+// Move up or down the DOM by one position.
+// Offsets are computed using layout text for nodes that have layoutObjects -
+// but note that even when using composed characters, the result may be inside
+// a single user-visible character if a ligature is formed.
+CORE_EXPORT Position previousPositionOf(const Position&, PositionMoveType);
+CORE_EXPORT Position nextPositionOf(const Position&, PositionMoveType);
+CORE_EXPORT PositionInComposedTree previousPositionOf(const PositionInComposedTree&, PositionMoveType);
+CORE_EXPORT PositionInComposedTree nextPositionOf(const PositionInComposedTree&, PositionMoveType);
+
+CORE_EXPORT int uncheckedPreviousOffset(const Node*, int current);
+CORE_EXPORT int uncheckedNextOffset(const Node*, int current);
+
// comparision functions on Position
// |disconnected| is optional output parameter having true if specified
« no previous file with comments | « no previous file | Source/core/editing/EditingUtilities.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698