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

Unified Diff: third_party/WebKit/Source/core/editing/VisibleUnits.cpp

Issue 2894803002: Use current selection when tab navigation. (Closed)
Patch Set: Fix selection direction Created 3 years, 7 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 | « third_party/WebKit/Source/core/editing/VisibleUnits.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « third_party/WebKit/Source/core/editing/VisibleUnits.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698