Index: third_party/WebKit/Source/core/editing/Editor.cpp |
diff --git a/third_party/WebKit/Source/core/editing/Editor.cpp b/third_party/WebKit/Source/core/editing/Editor.cpp |
index ce1da9ec34ced06e438f7647dde0cbd4303ae33b..3d14024799bffafc78c2f719d63aaf64683faa6f 100644 |
--- a/third_party/WebKit/Source/core/editing/Editor.cpp |
+++ b/third_party/WebKit/Source/core/editing/Editor.cpp |
@@ -171,13 +171,9 @@ VisibleSelection Editor::selectionForCommand(Event* event) { |
if (textControlOfTarget && |
(selection.start().isNull() || |
textControlOfTarget != textControlOfSelectionStart)) { |
- if (Range* range = textControlOfTarget->selection()) { |
- return createVisibleSelection( |
- SelectionInDOMTree::Builder() |
- .setBaseAndExtent(EphemeralRange(range)) |
- .setIsDirectional(selection.isDirectional()) |
- .build()); |
- } |
+ const SelectionInDOMTree& select = textControlOfTarget->selection(); |
+ if (!select.isNone()) |
+ return createVisibleSelection(select); |
} |
return selection; |
} |