Chromium Code Reviews| Index: third_party/WebKit/Source/core/editing/InputMethodController.cpp |
| diff --git a/third_party/WebKit/Source/core/editing/InputMethodController.cpp b/third_party/WebKit/Source/core/editing/InputMethodController.cpp |
| index 7aeb0d1f45878ec10d499195a6e38f8e40180923..89d9017dd73a84876001fe0f70e4733a8e58534d 100644 |
| --- a/third_party/WebKit/Source/core/editing/InputMethodController.cpp |
| +++ b/third_party/WebKit/Source/core/editing/InputMethodController.cpp |
| @@ -231,7 +231,7 @@ void InputMethodController::cancelCompositionIfSelectionIsInvalid() |
| frame().chromeClient().didCancelCompositionOnSelectionChange(); |
| } |
| -void InputMethodController::setComposition(const String& text, const Vector<CompositionUnderline>& underlines, unsigned selectionStart, unsigned selectionEnd) |
| +void InputMethodController::setComposition(const String& text, const Vector<CompositionUnderline>& underlines, int selectionStart, int selectionEnd) |
| { |
| Editor::RevealSelectionScope revealSelectionScope(&editor()); |
| @@ -319,8 +319,8 @@ void InputMethodController::setComposition(const String& text, const Vector<Comp |
| if (baseNode->layoutObject()) |
| baseNode->layoutObject()->setShouldDoFullPaintInvalidation(); |
| - unsigned start = std::min(baseOffset + selectionStart, extentOffset); |
| - unsigned end = std::min(std::max(start, baseOffset + selectionEnd), extentOffset); |
| + int start = std::min(std::max((int)baseOffset + selectionStart, 0), (int)extentOffset); |
|
Changwan Ryu
2016/04/01 00:37:26
baseOffset >= 0 so you just need to make sure sele
yabinh
2016/04/01 04:14:17
selectionStart can be negative, because it is the
Changwan Ryu
2016/04/01 05:36:15
I see. Thanks for clarification.
By the way, we pr
|
| + int end = std::min(std::max((int)baseOffset + selectionEnd, start), (int)extentOffset); |
| RefPtrWillBeRawPtr<Range> selectedRange = Range::create(baseNode->document(), baseNode, start, baseNode, end); |
| frame().selection().setSelectedRange(selectedRange.get(), TextAffinity::Downstream, SelectionDirectionalMode::NonDirectional, NotUserTriggered); |