Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(141)

Side by Side Diff: third_party/WebKit/Source/core/editing/InputMethodController.cpp

Issue 1965543002: [InputEvent] Support |sequence<Range> getRanges()| in 'beforeinput' (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 // only the last code-point so that it's possible for a user to correct 456 // only the last code-point so that it's possible for a user to correct
457 // a composition without starting it from the beginning. 457 // a composition without starting it from the beginning.
458 // http://crbug.com/37993 458 // http://crbug.com/37993
459 do { 459 do {
460 if (!setSelectionOffsets(PlainTextRange(std::max(static_cast<int>(select ionOffsets.start()) - before, 0), selectionOffsets.end() + after))) 460 if (!setSelectionOffsets(PlainTextRange(std::max(static_cast<int>(select ionOffsets.start()) - before, 0), selectionOffsets.end() + after)))
461 return; 461 return;
462 if (before == 0) 462 if (before == 0)
463 break; 463 break;
464 ++before; 464 ++before;
465 } while (frame().selection().start() == frame().selection().end() && before <= static_cast<int>(selectionOffsets.start())); 465 } while (frame().selection().start() == frame().selection().end() && before <= static_cast<int>(selectionOffsets.start()));
466 // TODO(chongz): According to spec |data| should be "forward" or "backward". 466 // TODO(chongz): New spec might want to change InputType.
467 dispatchBeforeInputEditorCommand(frame().document()->focusedElement(), Input Event::InputType::DeleteContent); 467 // https://github.com/w3c/editing/issues/125#issuecomment-213041256
468 dispatchBeforeInputEditorCommand(frame().document()->focusedElement(), Input Event::InputType::DeleteContent, emptyString(), HeapVector<Member<Range>>(1, fra me().selection().firstRange()));
468 TypingCommand::deleteSelection(*frame().document()); 469 TypingCommand::deleteSelection(*frame().document());
469 } 470 }
470 471
471 DEFINE_TRACE(InputMethodController) 472 DEFINE_TRACE(InputMethodController)
472 { 473 {
473 visitor->trace(m_frame); 474 visitor->trace(m_frame);
474 visitor->trace(m_compositionRange); 475 visitor->trace(m_compositionRange);
475 } 476 }
476 477
477 } // namespace blink 478 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698