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

Unified Diff: third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp

Issue 2558643003: [InputEvent] Move 'beforeinput' logic into |CompositeEditCommand::willApplyEditing()| (3/3) (Closed)
Patch Set: xiaocheng's review 2: Remove unrelated changes and added more checks Created 4 years 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/spellcheck/SpellChecker.cpp
diff --git a/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp b/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp
index 8f5d02fcde04afbc088fa57947373829a2047fe6..25b0d6d41a0f76d27cf1b43dd3a22b52247cbba6 100644
--- a/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp
+++ b/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp
@@ -829,32 +829,9 @@ void SpellChecker::replaceMisspelledRange(const String& text) {
frame().selection().setSelection(
SelectionInDOMTree::Builder().setBaseAndExtent(markerRange).build());
- Document& currentDocument = *frame().document();
-
- // Dispatch 'beforeinput'.
- Element* const target = frame().editor().findEventTargetFromSelection();
- RangeVector* const ranges =
- new RangeVector(1, frame().selection().firstRange());
- DataTransfer* const dataTransfer = DataTransfer::create(
- DataTransfer::DataTransferType::InsertReplacementText,
- DataTransferAccessPolicy::DataTransferReadable,
- DataObject::createFromString(text));
-
- const bool cancel =
- dispatchBeforeInputDataTransfer(
- target, InputEvent::InputType::InsertReplacementText, dataTransfer,
- ranges) != DispatchEventResult::NotCanceled;
-
- // 'beforeinput' event handler may destroy target frame.
- if (currentDocument != frame().document())
- return;
-
// TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
// needs to be audited. See http://crbug.com/590369 for more details.
frame().document()->updateStyleAndLayoutIgnorePendingStylesheets();
-
- if (cancel)
- return;
frame().editor().replaceSelectionForSpellChecker(text);
}

Powered by Google App Engine
This is Rietveld 408576698