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 eedf26046cc6765274d95f26be938f1ba1cd3882..a663c1eec032326508173a6bb2be2ce1f3cd6efe 100644 |
| --- a/third_party/WebKit/Source/core/editing/InputMethodController.cpp |
| +++ b/third_party/WebKit/Source/core/editing/InputMethodController.cpp |
| @@ -352,15 +352,14 @@ static int computeAbsoluteCaretPosition(size_t textStart, |
| void InputMethodController::addCompositionUnderlines( |
| const Vector<CompositionUnderline>& underlines, |
| - ContainerNode* rootEditableElement, |
| - unsigned offset) { |
| + ContainerNode* baseElement, |
| + unsigned offsetInPlainChars) { |
| for (const auto& underline : underlines) { |
| - unsigned underlineStart = offset + underline.startOffset(); |
| - unsigned underlineEnd = offset + underline.endOffset(); |
| + unsigned underlineStart = offsetInPlainChars + underline.startOffset(); |
| + unsigned underlineEnd = offsetInPlainChars + underline.endOffset(); |
| EphemeralRange ephemeralLineRange = |
| - PlainTextRange(underlineStart, underlineEnd) |
| - .createRange(*rootEditableElement); |
| + PlainTextRange(underlineStart, underlineEnd).createRange(*baseElement); |
| if (ephemeralLineRange.isNull()) |
| continue; |
| @@ -608,7 +607,10 @@ void InputMethodController::setComposition( |
| return; |
| } |
| - addCompositionUnderlines(underlines, baseNode->parentNode(), baseOffset); |
| + PlainTextRange compositionPlainTextRange = |
| + PlainTextRange::create(*baseNode->parentNode(), *m_compositionRange); |
| + addCompositionUnderlines(underlines, baseNode->parentNode(), |
|
rlanday
2017/02/16 00:37:54
Unfortunately I can't just work with baseNode dire
|
| + compositionPlainTextRange.start()); |
| } |
| PlainTextRange InputMethodController::createSelectionRangeForSetComposition( |