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

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: Update comments about store and clear |Range| Created 4 years, 6 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 524 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/Editor.h ('k') | third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698