Index: third_party/WebKit/Source/core/editing/SelectionTemplate.cpp |
diff --git a/third_party/WebKit/Source/core/editing/SelectionTemplate.cpp b/third_party/WebKit/Source/core/editing/SelectionTemplate.cpp |
index 36ef7ba5f453f83aaa81dd24b6dd88b566c9aaa0..42d2e24cc5bb3a26116bbab933247563a9c7971a 100644 |
--- a/third_party/WebKit/Source/core/editing/SelectionTemplate.cpp |
+++ b/third_party/WebKit/Source/core/editing/SelectionTemplate.cpp |
@@ -133,6 +133,32 @@ void SelectionTemplate<Strategy>::showTreeForThis() const { |
#endif |
template <typename Strategy> |
+const PositionTemplate<Strategy>& |
+SelectionTemplate<Strategy>::computeEndPosition() const { |
+ if (m_base == m_extent) |
+ return m_base; |
+ return m_base < m_extent ? m_extent : m_base; |
+} |
+ |
+template <typename Strategy> |
+const PositionTemplate<Strategy>& |
+SelectionTemplate<Strategy>::computeStartPosition() const { |
+ if (m_base == m_extent) |
+ return m_base; |
+ return m_base < m_extent ? m_base : m_extent; |
+} |
+ |
+template <typename Strategy> |
+SelectionType SelectionTemplate<Strategy>::selectionTypeWithLegacyGranularity() |
+ const { |
+ if (m_base.isNull()) |
+ return NoSelection; |
+ if (m_base == m_extent && m_granularity == CharacterGranularity) |
+ return CaretSelection; |
+ return RangeSelection; |
+} |
+ |
+template <typename Strategy> |
void SelectionTemplate<Strategy>::printTo(std::ostream* ostream, |
const char* type) const { |
if (isNone()) { |