Index: Source/core/editing/VisiblePosition.cpp |
diff --git a/Source/core/editing/VisiblePosition.cpp b/Source/core/editing/VisiblePosition.cpp |
index d293a59e78f61ec8733eb8d6cb153b83b65c48fa..2a5e5f3c8cb0d44b2dec058eec7be31986ef80fc 100644 |
--- a/Source/core/editing/VisiblePosition.cpp |
+++ b/Source/core/editing/VisiblePosition.cpp |
@@ -64,74 +64,6 @@ VisiblePosition VisiblePosition::createWithoutCanonicalization(const PositionWit |
return visiblePosition; |
} |
-template <typename Strategy> |
-PositionWithAffinityTemplate<Strategy> honorEditingBoundaryAtOrBeforeAlgorithm(const PositionWithAffinityTemplate<Strategy>& pos, const PositionAlgorithm<Strategy>& anchor) |
-{ |
- if (pos.isNull()) |
- return pos; |
- |
- ContainerNode* highestRoot = highestEditableRoot(anchor); |
- |
- // Return empty position if pos is not somewhere inside the editable region containing this position |
- if (highestRoot && !pos.position().anchorNode()->isDescendantOf(highestRoot)) |
- return PositionWithAffinityTemplate<Strategy>(); |
- |
- // Return pos itself if the two are from the very same editable region, or both are non-editable |
- // FIXME: In the non-editable case, just because the new position is non-editable doesn't mean movement |
- // to it is allowed. VisibleSelection::adjustForEditableContent has this problem too. |
- if (highestEditableRoot(pos.position()) == highestRoot) |
- return pos; |
- |
- // Return empty position if this position is non-editable, but pos is editable |
- // FIXME: Move to the previous non-editable region. |
- if (!highestRoot) |
- return PositionWithAffinityTemplate<Strategy>(); |
- |
- // Return the last position before pos that is in the same editable region as this position |
- return lastEditablePositionBeforePositionInRoot(pos.position(), highestRoot); |
-} |
- |
-PositionWithAffinity honorEditingBoundaryAtOrBeforeOf(const PositionWithAffinity& pos, const Position& anchor) |
-{ |
- return honorEditingBoundaryAtOrBeforeAlgorithm(pos, anchor); |
-} |
- |
-PositionInComposedTreeWithAffinity honorEditingBoundaryAtOrBeforeOf(const PositionInComposedTreeWithAffinity& pos, const PositionInComposedTree& anchor) |
-{ |
- return honorEditingBoundaryAtOrBeforeAlgorithm(pos, anchor); |
-} |
- |
-VisiblePosition honorEditingBoundaryAtOrBefore(const VisiblePosition& pos, const Position& anchor) |
-{ |
- return createVisiblePosition(honorEditingBoundaryAtOrBeforeOf(pos.toPositionWithAffinity(), anchor)); |
-} |
- |
-VisiblePosition honorEditingBoundaryAtOrAfter(const VisiblePosition& pos, const Position& anchor) |
-{ |
- if (pos.isNull()) |
- return pos; |
- |
- ContainerNode* highestRoot = highestEditableRoot(anchor); |
- |
- // Return empty position if pos is not somewhere inside the editable region containing this position |
- if (highestRoot && !pos.deepEquivalent().anchorNode()->isDescendantOf(highestRoot)) |
- return VisiblePosition(); |
- |
- // Return pos itself if the two are from the very same editable region, or both are non-editable |
- // FIXME: In the non-editable case, just because the new position is non-editable doesn't mean movement |
- // to it is allowed. VisibleSelection::adjustForEditableContent has this problem too. |
- if (highestEditableRoot(pos.deepEquivalent()) == highestRoot) |
- return pos; |
- |
- // Return empty position if this position is non-editable, but pos is editable |
- // FIXME: Move to the next non-editable region. |
- if (!highestRoot) |
- return VisiblePosition(); |
- |
- // Return the next position after pos that is in the same editable region as this position |
- return firstEditableVisiblePositionAfterPositionInRoot(pos.deepEquivalent(), highestRoot); |
-} |
- |
template<typename Strategy> |
static PositionWithAffinityTemplate<Strategy> createVisiblePositionAlgorithm(const PositionAlgorithm<Strategy>& position, TextAffinity affinity) |
{ |