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

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

Issue 1320313002: Move makeRange() with VisiblePosition to EditingUtilities.cpp from VisiblePosition.cpp (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-31T14:11:43 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/EditingUtilities.h ('k') | Source/core/editing/VisiblePosition.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/EditingUtilities.cpp
diff --git a/Source/core/editing/EditingUtilities.cpp b/Source/core/editing/EditingUtilities.cpp
index 7a7148bb41ca301b61ed411a042b07df4d6b93d5..e4905bc2ba6ab45b1d818a00417704bde1528289 100644
--- a/Source/core/editing/EditingUtilities.cpp
+++ b/Source/core/editing/EditingUtilities.cpp
@@ -1511,6 +1511,19 @@ int indexForVisiblePosition(const VisiblePosition& visiblePosition, RefPtrWillBe
return TextIterator::rangeLength(range->startPosition(), range->endPosition(), true);
}
+EphemeralRange makeRange(const VisiblePosition &start, const VisiblePosition &end)
+{
+ if (start.isNull() || end.isNull())
+ return EphemeralRange();
+
+ Position s = start.deepEquivalent().parentAnchoredEquivalent();
+ Position e = end.deepEquivalent().parentAnchoredEquivalent();
+ if (s.isNull() || e.isNull())
+ return EphemeralRange();
+
+ return EphemeralRange(s, e);
+}
+
VisiblePosition visiblePositionForIndex(int index, ContainerNode* scope)
{
if (!scope)
« no previous file with comments | « Source/core/editing/EditingUtilities.h ('k') | Source/core/editing/VisiblePosition.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698