| Index: third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp
|
| diff --git a/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp b/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp
|
| index 478c8b7fccde663f9bbb365f8b1a32b4f2aac3e0..43943aafafc7c621b82a5e19337b355ac8973f41 100644
|
| --- a/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp
|
| +++ b/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp
|
| @@ -1805,8 +1805,23 @@ static bool executeYank(LocalFrame& frame,
|
| Event*,
|
| EditorCommandSource,
|
| const String&) {
|
| + const String& yankString = frame.editor().killRing().yank();
|
| + if (dispatchBeforeInputInsertText(
|
| + eventTargetNodeForDocument(frame.document()), yankString,
|
| + InputEvent::InputType::InsertFromYank) !=
|
| + DispatchEventResult::NotCanceled)
|
| + return true;
|
| +
|
| + // 'beforeinput' event handler may destroy document.
|
| + if (frame.document()->frame() != &frame)
|
| + return false;
|
| +
|
| + // TODO(editing-dev): The use of updateStyleAndLayoutIgnorePendingStylesheets
|
| + // needs to be audited. see http://crbug.com/590369 for more details.
|
| + frame.document()->updateStyleAndLayoutIgnorePendingStylesheets();
|
| +
|
| frame.editor().insertTextWithoutSendingTextEvent(
|
| - frame.editor().killRing().yank(), false, 0);
|
| + yankString, false, 0, InputEvent::InputType::InsertFromYank);
|
| frame.editor().killRing().setToYankedState();
|
| return true;
|
| }
|
| @@ -1815,8 +1830,24 @@ static bool executeYankAndSelect(LocalFrame& frame,
|
| Event*,
|
| EditorCommandSource,
|
| const String&) {
|
| + const String& yankString = frame.editor().killRing().yank();
|
| + if (dispatchBeforeInputInsertText(
|
| + eventTargetNodeForDocument(frame.document()), yankString,
|
| + InputEvent::InputType::InsertFromYank) !=
|
| + DispatchEventResult::NotCanceled)
|
| + return true;
|
| +
|
| + // 'beforeinput' event handler may destroy document.
|
| + if (frame.document()->frame() != &frame)
|
| + return false;
|
| +
|
| + // TODO(editing-dev): The use of updateStyleAndLayoutIgnorePendingStylesheets
|
| + // needs to be audited. see http://crbug.com/590369 for more details.
|
| + frame.document()->updateStyleAndLayoutIgnorePendingStylesheets();
|
| +
|
| frame.editor().insertTextWithoutSendingTextEvent(
|
| - frame.editor().killRing().yank(), true, 0);
|
| + frame.editor().killRing().yank(), true, 0,
|
| + InputEvent::InputType::InsertFromYank);
|
| frame.editor().killRing().setToYankedState();
|
| return true;
|
| }
|
|
|