| 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 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 535 // only the last code-point so that it's possible for a user to correct | 535 // only the last code-point so that it's possible for a user to correct |
| 536 // a composition without starting it from the beginning. | 536 // a composition without starting it from the beginning. |
| 537 // http://crbug.com/37993 | 537 // http://crbug.com/37993 |
| 538 do { | 538 do { |
| 539 if (!setSelectionOffsets(PlainTextRange(std::max(static_cast<int>(select
ionOffsets.start()) - before, 0), selectionOffsets.end() + after))) | 539 if (!setSelectionOffsets(PlainTextRange(std::max(static_cast<int>(select
ionOffsets.start()) - before, 0), selectionOffsets.end() + after))) |
| 540 return; | 540 return; |
| 541 if (before == 0) | 541 if (before == 0) |
| 542 break; | 542 break; |
| 543 ++before; | 543 ++before; |
| 544 } while (frame().selection().start() == frame().selection().end() && before
<= static_cast<int>(selectionOffsets.start())); | 544 } while (frame().selection().start() == frame().selection().end() && before
<= static_cast<int>(selectionOffsets.start())); |
| 545 // TODO(chongz): According to spec |data| should be "forward" or "backward". | 545 // TODO(chongz): New spec might want to change InputType. |
| 546 dispatchBeforeInputEditorCommand(frame().document()->focusedElement(), Input
Event::InputType::DeleteContent); | 546 // https://github.com/w3c/editing/issues/125#issuecomment-213041256 |
| 547 dispatchBeforeInputEditorCommand(m_frame->document()->focusedElement(), Inpu
tEvent::InputType::DeleteContent, emptyString(), new RangeVector(1, m_frame->sel
ection().firstRange())); |
| 547 TypingCommand::deleteSelection(*frame().document()); | 548 TypingCommand::deleteSelection(*frame().document()); |
| 548 } | 549 } |
| 549 | 550 |
| 550 DEFINE_TRACE(InputMethodController) | 551 DEFINE_TRACE(InputMethodController) |
| 551 { | 552 { |
| 552 visitor->trace(m_frame); | 553 visitor->trace(m_frame); |
| 553 visitor->trace(m_compositionRange); | 554 visitor->trace(m_compositionRange); |
| 554 } | 555 } |
| 555 | 556 |
| 556 } // namespace blink | 557 } // namespace blink |
| OLD | NEW |