Commit 9dea9705 authored by Xiaocheng Hu's avatar Xiaocheng Hu Committed by Commit Bot

Stop using CreateVisiblePosition in DragCaret::SetCaretPosition

The passed-in position in DragCaret::SetCaretPosition is a hit test
result (see DragController::TryDocumentDrag), which is already a
canonical position. Hence, there's no need to canonicalize it again.

Bug: 897983
Change-Id: I58f9bff731842a4d9f7c201f95ec2af769e158d7
Reviewed-on: https://chromium-review.googlesource.com/c/1297641Reviewed-by: default avatarYoshifumi Inoue <yosin@chromium.org>
Reviewed-by: default avatarYoichi Osato <yoichio@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#602393}
parent 2e459d99
...@@ -66,7 +66,7 @@ bool DragCaret::IsContentRichlyEditable() const { ...@@ -66,7 +66,7 @@ bool DragCaret::IsContentRichlyEditable() const {
} }
void DragCaret::SetCaretPosition(const PositionWithAffinity& position) { void DragCaret::SetCaretPosition(const PositionWithAffinity& position) {
position_ = CreateVisiblePosition(position).ToPositionWithAffinity(); position_ = position;
Document* document = nullptr; Document* document = nullptr;
if (Node* node = position_.AnchorNode()) { if (Node* node = position_.AnchorNode()) {
document = &node->GetDocument(); document = &node->GetDocument();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment