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

Unified Diff: Source/core/editing/htmlediting.cpp

Issue 1201153002: Introduce composed tree version of canonicalPosition() in VisiblePosition (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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
Index: Source/core/editing/htmlediting.cpp
diff --git a/Source/core/editing/htmlediting.cpp b/Source/core/editing/htmlediting.cpp
index 92908f769e5911808fa7392c593488c1fda0fcff..cbaacdad8b11127f3a91d37028e28a4beeab6a5f 100644
--- a/Source/core/editing/htmlediting.cpp
+++ b/Source/core/editing/htmlediting.cpp
@@ -196,6 +196,11 @@ Element* editableRootForPosition(const Position& p, EditableType editableType)
return node->rootEditableElement(editableType);
}
+Element* editableRootForPosition(const PositionInComposedTree& p, EditableType editableType)
+{
+ return editableRootForPosition(toPositionInDOMTree(p), editableType);
+}
+
// Finds the enclosing element until which the tree can be split.
// When a user hits ENTER, he/she won't expect this element to be split into two.
// You may pass it as the second argument of splitTreeToNode.
@@ -228,6 +233,11 @@ Position nextCandidate(const Position& position)
return nextCandidateAlgorithm<EditingStrategy>(position);
}
+PositionInComposedTree nextCandidate(const PositionInComposedTree& position)
+{
+ return nextCandidateAlgorithm<EditingInComposedTreeStrategy>(position);
+}
+
Position nextVisuallyDistinctCandidate(const Position& position)
{
Position p = position;
@@ -258,6 +268,11 @@ Position previousCandidate(const Position& position)
return previousCandidateAlgorithm<EditingStrategy>(position);
}
+PositionInComposedTree previousCandidate(const PositionInComposedTree& position)
+{
+ return previousCandidateAlgorithm<EditingInComposedTreeStrategy>(position);
+}
+
template <typename PositionType>
PositionType previousVisuallyDistinctCandidateAlgorithm(const PositionType& position)
{
« Source/core/editing/VisiblePositionTest.cpp ('K') | « Source/core/editing/htmlediting.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698