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

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

Issue 2941013003: Introduce ComputeInlineBoxPositionForTextNode() (Closed)
Patch Set: 2017-06-15T15:39:24 Created 3 years, 6 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 | « no previous file | 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 cd66924d14ea243eaf3f0c0ff8f48b5b5a17ce57..d4355c86858b648cfbc2d8743d4387c817b425bb 100644
--- a/third_party/WebKit/Source/core/editing/VisibleUnits.cpp
+++ b/third_party/WebKit/Source/core/editing/VisibleUnits.cpp
@@ -769,6 +769,13 @@ static bool IsCaretAtEdgeOfInlineTextBox(int caret_offset,
return box.NextLeafChild() && box.NextLeafChild()->IsLineBreak();
}
+// TODO(yosin): We have a forward declaration here to reduce patch size. We'll
+// replace this with an implementation once review finished.
+static InlineBoxPosition ComputeInlineBoxPositionForTextNode(LayoutObject*,
+ int caret_offset,
+ TextAffinity,
+ TextDirection);
+
template <typename Strategy>
static InlineBoxPosition ComputeInlineBoxPositionTemplate(
const PositionTemplate<Strategy>& position,
@@ -821,6 +828,17 @@ static InlineBoxPosition ComputeInlineBoxPositionTemplate(
primary_direction);
}
+ return ComputeInlineBoxPositionForTextNode(layout_object, caret_offset,
+ affinity, primary_direction);
+}
+
+// TODO(yosin): We should make |ComputeInlineBoxPositionForTextNode()| to take
+// |const LayoutText&|.
+static InlineBoxPosition ComputeInlineBoxPositionForTextNode(
+ LayoutObject* layout_object,
+ int caret_offset,
+ TextAffinity affinity,
+ TextDirection primary_direction) {
// TODO(yosin): We should move this code fragment to another function to
// remove the scope.
InlineBox* inline_box = nullptr;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698