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

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

Issue 1313883002: Introduce firstRangeOf() as replacement of VisibleSelection::firstRange() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-25T17:47:14 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/VisibleSelection.h ('k') | Source/core/editing/VisibleSelectionTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/VisibleSelection.cpp
diff --git a/Source/core/editing/VisibleSelection.cpp b/Source/core/editing/VisibleSelection.cpp
index c0181c12bd7402842a092f053a0dc055849a9406..a331d3c3e5e03689fbe629cb295f0bdcf23c668b 100644
--- a/Source/core/editing/VisibleSelection.cpp
+++ b/Source/core/editing/VisibleSelection.cpp
@@ -216,12 +216,12 @@ PositionInComposedTree VisibleSelection::endInComposedTree() const
return m_endInComposedTree;
}
-PassRefPtrWillBeRawPtr<Range> VisibleSelection::firstRange() const
+PassRefPtrWillBeRawPtr<Range> firstRangeOf(const VisibleSelection& selection)
{
- if (isNone())
+ if (selection.isNone())
return nullptr;
- Position start = m_start.parentAnchoredEquivalent();
- Position end = m_end.parentAnchoredEquivalent();
+ Position start = selection.start().parentAnchoredEquivalent();
+ Position end = selection.end().parentAnchoredEquivalent();
return Range::create(*start.document(), start, end);
}
« no previous file with comments | « Source/core/editing/VisibleSelection.h ('k') | Source/core/editing/VisibleSelectionTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698