| 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 775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 786 // a composition without starting it from the beginning. | 786 // a composition without starting it from the beginning. |
| 787 // http://crbug.com/37993 | 787 // http://crbug.com/37993 |
| 788 do { | 788 do { |
| 789 if (!setSelectionOffsets(PlainTextRange( | 789 if (!setSelectionOffsets(PlainTextRange( |
| 790 std::max(static_cast<int>(selectionOffsets.start()) - before, 0), | 790 std::max(static_cast<int>(selectionOffsets.start()) - before, 0), |
| 791 selectionOffsets.end() + after))) | 791 selectionOffsets.end() + after))) |
| 792 return; | 792 return; |
| 793 if (before == 0) | 793 if (before == 0) |
| 794 break; | 794 break; |
| 795 ++before; | 795 ++before; |
| 796 } while (frame().selection().start() == frame().selection().end() && | 796 } while (frame().selection().start() == |
| 797 frame() |
| 798 .selection() |
| 799 .computeVisibleSelectionInDOMTreeDeprecated() |
| 800 .end() && |
| 797 before <= static_cast<int>(selectionOffsets.start())); | 801 before <= static_cast<int>(selectionOffsets.start())); |
| 798 // TODO(chongz): Find a way to distinguish Forward and Backward. | 802 // TODO(chongz): Find a way to distinguish Forward and Backward. |
| 799 Node* target = document().focusedElement(); | 803 Node* target = document().focusedElement(); |
| 800 if (target) { | 804 if (target) { |
| 801 dispatchBeforeInputEditorCommand( | 805 dispatchBeforeInputEditorCommand( |
| 802 target, InputEvent::InputType::DeleteContentBackward, | 806 target, InputEvent::InputType::DeleteContentBackward, |
| 803 targetRangesForInputEvent(*target)); | 807 targetRangesForInputEvent(*target)); |
| 804 } | 808 } |
| 805 TypingCommand::deleteSelection(document()); | 809 TypingCommand::deleteSelection(document()); |
| 806 } | 810 } |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1086 finishComposingText(DoNotKeepSelection); | 1090 finishComposingText(DoNotKeepSelection); |
| 1087 } | 1091 } |
| 1088 | 1092 |
| 1089 DEFINE_TRACE(InputMethodController) { | 1093 DEFINE_TRACE(InputMethodController) { |
| 1090 visitor->trace(m_frame); | 1094 visitor->trace(m_frame); |
| 1091 visitor->trace(m_compositionRange); | 1095 visitor->trace(m_compositionRange); |
| 1092 SynchronousMutationObserver::trace(visitor); | 1096 SynchronousMutationObserver::trace(visitor); |
| 1093 } | 1097 } |
| 1094 | 1098 |
| 1095 } // namespace blink | 1099 } // namespace blink |
| OLD | NEW |