Index: third_party/WebKit/Source/core/editing/VisibleUnits.cpp |
diff --git a/third_party/WebKit/Source/core/editing/VisibleUnits.cpp b/third_party/WebKit/Source/core/editing/VisibleUnits.cpp |
index e9a3f6587ca79071a0f9fee72bcbc839bb075802..d9581dfe9ccafa1515a22fd2f92a319d8b7395f4 100644 |
--- a/third_party/WebKit/Source/core/editing/VisibleUnits.cpp |
+++ b/third_party/WebKit/Source/core/editing/VisibleUnits.cpp |
@@ -4119,10 +4119,11 @@ static void CollectAbsoluteBoundsForRange(unsigned start, |
layout_text.AbsoluteQuadsForRange(quads, start, end); |
} |
-template <typename RectType> |
-static Vector<RectType> ComputeTextBounds(const EphemeralRange& range) { |
- const Position& start_position = range.StartPosition(); |
- const Position& end_position = range.EndPosition(); |
+template <typename RectType, typename Strategy> |
+static Vector<RectType> ComputeTextBounds( |
+ const EphemeralRangeTemplate<Strategy>& range) { |
+ const PositionTemplate<Strategy>& start_position = range.StartPosition(); |
+ const PositionTemplate<Strategy>& end_position = range.EndPosition(); |
Node* const start_container = start_position.ComputeContainerNode(); |
DCHECK(start_container); |
Node* const end_container = end_position.ComputeContainerNode(); |
@@ -4145,14 +4146,24 @@ static Vector<RectType> ComputeTextBounds(const EphemeralRange& range) { |
return result; |
} |
-IntRect ComputeTextRect(const EphemeralRange& range) { |
+template <typename Strategy> |
+static IntRect ComputeTextRectTemplate( |
+ const EphemeralRangeTemplate<Strategy>& range) { |
IntRect result; |
- const Vector<IntRect>& rects = ComputeTextBounds<IntRect>(range); |
+ const Vector<IntRect>& rects = ComputeTextBounds<IntRect, Strategy>(range); |
for (const IntRect& rect : rects) |
result.Unite(rect); |
return result; |
} |
+IntRect ComputeTextRect(const EphemeralRange& range) { |
+ return ComputeTextRectTemplate(range); |
+} |
+ |
+IntRect ComputeTextRect(const EphemeralRangeInFlatTree& range) { |
+ return ComputeTextRectTemplate(range); |
+} |
+ |
Vector<FloatQuad> ComputeTextQuads(const EphemeralRange& range) { |
return ComputeTextBounds<FloatQuad>(range); |
} |