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

Side by Side Diff: third_party/WebKit/Source/core/editing/InputMethodController.cpp

Issue 2689233006: Fix bug on Android causing composition underlines to appear in the wrong place (Closed)
Patch Set: Don't change param names Created 3 years, 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after
613 setEditableSelectionOffsets(selectedRange, NotUserTriggered); 613 setEditableSelectionOffsets(selectedRange, NotUserTriggered);
614 614
615 if (underlines.isEmpty()) { 615 if (underlines.isEmpty()) {
616 document().markers().addCompositionMarker( 616 document().markers().addCompositionMarker(
617 m_compositionRange->startPosition(), m_compositionRange->endPosition(), 617 m_compositionRange->startPosition(), m_compositionRange->endPosition(),
618 Color::black, false, 618 Color::black, false,
619 LayoutTheme::theme().platformDefaultCompositionBackgroundColor()); 619 LayoutTheme::theme().platformDefaultCompositionBackgroundColor());
620 return; 620 return;
621 } 621 }
622 622
623 addCompositionUnderlines(underlines, baseNode->parentNode(), baseOffset); 623 const PlainTextRange compositionPlainTextRange =
624 PlainTextRange::create(*baseNode->parentNode(), *m_compositionRange);
625 addCompositionUnderlines(underlines, baseNode->parentNode(),
626 compositionPlainTextRange.start());
624 } 627 }
625 628
626 PlainTextRange InputMethodController::createSelectionRangeForSetComposition( 629 PlainTextRange InputMethodController::createSelectionRangeForSetComposition(
627 int selectionStart, 630 int selectionStart,
628 int selectionEnd, 631 int selectionEnd,
629 size_t textLength) const { 632 size_t textLength) const {
630 const int selectionOffsetsStart = 633 const int selectionOffsetsStart =
631 static_cast<int>(getSelectionOffsets().start()); 634 static_cast<int>(getSelectionOffsets().start());
632 const int start = selectionOffsetsStart + selectionStart; 635 const int start = selectionOffsetsStart + selectionStart;
633 const int end = selectionOffsetsStart + selectionEnd; 636 const int end = selectionOffsetsStart + selectionEnd;
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
1119 finishComposingText(DoNotKeepSelection); 1122 finishComposingText(DoNotKeepSelection);
1120 } 1123 }
1121 1124
1122 DEFINE_TRACE(InputMethodController) { 1125 DEFINE_TRACE(InputMethodController) {
1123 visitor->trace(m_frame); 1126 visitor->trace(m_frame);
1124 visitor->trace(m_compositionRange); 1127 visitor->trace(m_compositionRange);
1125 SynchronousMutationObserver::trace(visitor); 1128 SynchronousMutationObserver::trace(visitor);
1126 } 1129 }
1127 1130
1128 } // namespace blink 1131 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698