| 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 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 // only the last code-point so that it's possible for a user to correct | 477 // only the last code-point so that it's possible for a user to correct |
| 478 // a composition without starting it from the beginning. | 478 // a composition without starting it from the beginning. |
| 479 // http://crbug.com/37993 | 479 // http://crbug.com/37993 |
| 480 do { | 480 do { |
| 481 if (!setSelectionOffsets(PlainTextRange(std::max(static_cast<int>(select
ionOffsets.start()) - before, 0), selectionOffsets.end() + after))) | 481 if (!setSelectionOffsets(PlainTextRange(std::max(static_cast<int>(select
ionOffsets.start()) - before, 0), selectionOffsets.end() + after))) |
| 482 return; | 482 return; |
| 483 if (before == 0) | 483 if (before == 0) |
| 484 break; | 484 break; |
| 485 ++before; | 485 ++before; |
| 486 } while (frame().selection().start() == frame().selection().end() && before
<= static_cast<int>(selectionOffsets.start())); | 486 } while (frame().selection().start() == frame().selection().end() && before
<= static_cast<int>(selectionOffsets.start())); |
| 487 // TODO(chongz): According to spec |data| should be "forward" or "backward". | 487 // TODO(chongz): New spec might want to change InputType. |
| 488 dispatchBeforeInputEditorCommand(frame().document()->focusedElement(), Input
Event::InputType::DeleteContent); | 488 // https://github.com/w3c/editing/issues/125#issuecomment-213041256 |
| 489 dispatchBeforeInputEditorCommand(frame().document()->focusedElement(), Input
Event::InputType::DeleteContent, emptyString(), new RangeVector(1, frame().selec
tion().firstRange())); |
| 489 TypingCommand::deleteSelection(*frame().document()); | 490 TypingCommand::deleteSelection(*frame().document()); |
| 490 } | 491 } |
| 491 | 492 |
| 492 DEFINE_TRACE(InputMethodController) | 493 DEFINE_TRACE(InputMethodController) |
| 493 { | 494 { |
| 494 visitor->trace(m_frame); | 495 visitor->trace(m_frame); |
| 495 visitor->trace(m_compositionRange); | 496 visitor->trace(m_compositionRange); |
| 496 } | 497 } |
| 497 | 498 |
| 498 } // namespace blink | 499 } // namespace blink |
| OLD | NEW |