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

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

Issue 1329253002: WIP: prefer using EphemeralRange for SpellChecker. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: introduce Range::dispose() Created 5 years, 3 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/VisibleSelection.cpp
diff --git a/Source/core/editing/VisibleSelection.cpp b/Source/core/editing/VisibleSelection.cpp
index 4f780ba57ce27365d0f3cb6e760583a6f71a8b6f..9b3a0a1df98988528504b026556975697fe0bc6d 100644
--- a/Source/core/editing/VisibleSelection.cpp
+++ b/Source/core/editing/VisibleSelection.cpp
@@ -230,6 +230,15 @@ PassRefPtrWillBeRawPtr<Range> firstRangeOf(const VisibleSelection& selection)
return Range::create(*start.document(), start, end);
}
+EphemeralRange firstEphemeralRangeOf(const VisibleSelection& selection)
+{
+ if (selection.isNone())
+ return EphemeralRange();
+ Position start = selection.start().parentAnchoredEquivalent();
+ Position end = selection.end().parentAnchoredEquivalent();
+ return EphemeralRange(start, end);
+}
+
EphemeralRange VisibleSelection::toNormalizedEphemeralRange() const
{
if (isNone())

Powered by Google App Engine
This is Rietveld 408576698