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

Unified Diff: third_party/WebKit/Source/core/editing/InputMethodController.cpp

Issue 2693863003: [InputEvent] Change |getTargetRanges()| to return current selection by default (Closed)
Patch Set: yosin's review: Use const Node&, add null checks Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/editing/InputMethodController.cpp
diff --git a/third_party/WebKit/Source/core/editing/InputMethodController.cpp b/third_party/WebKit/Source/core/editing/InputMethodController.cpp
index dd5e4e66636284921fc638683c840c8320d37608..e0addcd8dfe251a68edb598967d706f96bbfed3f 100644
--- a/third_party/WebKit/Source/core/editing/InputMethodController.cpp
+++ b/third_party/WebKit/Source/core/editing/InputMethodController.cpp
@@ -821,11 +821,13 @@ void InputMethodController::extendSelectionAndDelete(int before, int after) {
++before;
} while (frame().selection().start() == frame().selection().end() &&
before <= static_cast<int>(selectionOffsets.start()));
- Range* const range = firstRangeOf(frame().selection().selection());
// TODO(chongz): Find a way to distinguish Forward and Backward.
- dispatchBeforeInputEditorCommand(document().focusedElement(),
- InputEvent::InputType::DeleteContentBackward,
- new RangeVector(1, range));
+ Node* target = document().focusedElement();
+ if (target) {
+ dispatchBeforeInputEditorCommand(
+ target, InputEvent::InputType::DeleteContentBackward,
+ targetRangesForInputEvent(*target));
+ }
TypingCommand::deleteSelection(document());
}

Powered by Google App Engine
This is Rietveld 408576698