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

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

Issue 1305963003: Introduce {next,previous}PositionOf() as replacement of {next,previous}() member functions in Positi (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-22T00:12:04 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 | « Source/core/editing/Editor.cpp ('k') | Source/core/editing/Position.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/Position.h
diff --git a/Source/core/editing/Position.h b/Source/core/editing/Position.h
index b6dec6faec8576217a631246c545af3f08ce37b5..1a7b840b9ef3ad31c3d302adb6b0584c29d796b3 100644
--- a/Source/core/editing/Position.h
+++ b/Source/core/editing/Position.h
@@ -45,7 +45,7 @@ class Text;
enum class TextAffinity;
class TreeScope;
-enum PositionMoveType {
+enum class PositionMoveType {
CodePoint, // Move by a single code point.
Character, // Move to the next Unicode character break.
BackwardDeletion // Subject to platform conventions.
@@ -149,12 +149,6 @@ public:
bool isNotNull() const { return m_anchorNode; }
bool isOrphan() const { return m_anchorNode && !m_anchorNode->inDocument(); }
- // 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.
- PositionAlgorithm<Strategy> previous(PositionMoveType = CodePoint) const;
- PositionAlgorithm<Strategy> next(PositionMoveType = CodePoint) const;
-
int compareTo(const PositionAlgorithm<Strategy>&) const;
// These can be either inside or just before/after the node, depending on
@@ -407,6 +401,18 @@ inline PositionInComposedTree fromPositionInDOMTree<EditingInComposedTreeStrateg
return toPositionInComposedTree(position);
}
+// TODO(yosin) We should move |previousPositionOf()| and |nextPositionOf()|
+// to "EditingUtilities.h" with |uncheckedPreviousOffset()| and
+// |uncheckedNextOffset()|.
+// 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);
« no previous file with comments | « Source/core/editing/Editor.cpp ('k') | Source/core/editing/Position.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698