| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |