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

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

Issue 1328493002: Move static member function normalizeRange() out from VisibleSelection (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-09-01T16:34:49 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/serializers/Serialization.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 cdce6dfccae2a34d844b53f9c290cf54cce9ce2a..4715c966dfa3af5ef3750eb6673786b48e700fb2 100644
--- a/Source/core/editing/VisibleSelection.cpp
+++ b/Source/core/editing/VisibleSelection.cpp
@@ -230,33 +230,6 @@ PassRefPtrWillBeRawPtr<Range> firstRangeOf(const VisibleSelection& selection)
return Range::create(*start.document(), start, end);
}
-template <typename Strategy>
-static EphemeralRangeTemplate<Strategy> normalizeRangeAlgorithm(const EphemeralRangeTemplate<Strategy>& range)
-{
- ASSERT(range.isNotNull());
- range.document().updateLayoutIgnorePendingStylesheets();
-
- // TODO(yosin) We should not call |parentAnchoredEquivalent()|, it is
- // redundant.
- const PositionAlgorithm<Strategy> normalizedStart = mostForwardCaretPosition(range.startPosition()).parentAnchoredEquivalent();
- const PositionAlgorithm<Strategy> normalizedEnd = mostBackwardCaretPosition(range.endPosition()).parentAnchoredEquivalent();
- // The order of the positions of |start| and |end| can be swapped after
- // upstream/downstream. e.g. editing/pasteboard/copy-display-none.html
- if (normalizedStart.compareTo(normalizedEnd) > 0)
- return EphemeralRangeTemplate<Strategy>(normalizedEnd, normalizedStart);
- return EphemeralRangeTemplate<Strategy>(normalizedStart, normalizedEnd);
-}
-
-EphemeralRange VisibleSelection::normalizeRange(const EphemeralRange& range)
-{
- return normalizeRangeAlgorithm<EditingStrategy>(range);
-}
-
-EphemeralRangeInComposedTree VisibleSelection::normalizeRange(const EphemeralRangeInComposedTree& range)
-{
- return normalizeRangeAlgorithm<EditingInComposedTreeStrategy>(range);
-}
-
EphemeralRange VisibleSelection::toNormalizedEphemeralRange() const
{
if (isNone())
« no previous file with comments | « Source/core/editing/VisibleSelection.h ('k') | Source/core/editing/serializers/Serialization.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698