| 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 798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 809 // a composition without starting it from the beginning. | 809 // a composition without starting it from the beginning. |
| 810 // http://crbug.com/37993 | 810 // http://crbug.com/37993 |
| 811 do { | 811 do { |
| 812 if (!setSelectionOffsets(PlainTextRange( | 812 if (!setSelectionOffsets(PlainTextRange( |
| 813 std::max(static_cast<int>(selectionOffsets.start()) - before, 0), | 813 std::max(static_cast<int>(selectionOffsets.start()) - before, 0), |
| 814 selectionOffsets.end() + after))) | 814 selectionOffsets.end() + after))) |
| 815 return; | 815 return; |
| 816 if (before == 0) | 816 if (before == 0) |
| 817 break; | 817 break; |
| 818 ++before; | 818 ++before; |
| 819 } while (frame().selection().start() == | 819 } while (frame().selection() |
| 820 .computeVisibleSelectionInDOMTreeDeprecated() |
| 821 .start() == |
| 820 frame() | 822 frame() |
| 821 .selection() | 823 .selection() |
| 822 .computeVisibleSelectionInDOMTreeDeprecated() | 824 .computeVisibleSelectionInDOMTreeDeprecated() |
| 823 .end() && | 825 .end() && |
| 824 before <= static_cast<int>(selectionOffsets.start())); | 826 before <= static_cast<int>(selectionOffsets.start())); |
| 825 // TODO(chongz): Find a way to distinguish Forward and Backward. | 827 // TODO(chongz): Find a way to distinguish Forward and Backward. |
| 826 Node* target = document().focusedElement(); | 828 Node* target = document().focusedElement(); |
| 827 if (target) { | 829 if (target) { |
| 828 dispatchBeforeInputEditorCommand( | 830 dispatchBeforeInputEditorCommand( |
| 829 target, InputEvent::InputType::DeleteContentBackward, | 831 target, InputEvent::InputType::DeleteContentBackward, |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1119 finishComposingText(DoNotKeepSelection); | 1121 finishComposingText(DoNotKeepSelection); |
| 1120 } | 1122 } |
| 1121 | 1123 |
| 1122 DEFINE_TRACE(InputMethodController) { | 1124 DEFINE_TRACE(InputMethodController) { |
| 1123 visitor->trace(m_frame); | 1125 visitor->trace(m_frame); |
| 1124 visitor->trace(m_compositionRange); | 1126 visitor->trace(m_compositionRange); |
| 1125 SynchronousMutationObserver::trace(visitor); | 1127 SynchronousMutationObserver::trace(visitor); |
| 1126 } | 1128 } |
| 1127 | 1129 |
| 1128 } // namespace blink | 1130 } // namespace blink |
| OLD | NEW |