| Index: third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.h
|
| diff --git a/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.h b/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.h
|
| index f6c2930ffa5ed34bbca22557c192a8fac3e8c561..2f9f88cb64664d52c01f0536ab9e05b3528bc676 100644
|
| --- a/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.h
|
| +++ b/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.h
|
| @@ -43,6 +43,9 @@ class HTMLSpanElement;
|
| class Text;
|
|
|
| enum class EditCommandSource { kMenuOrKeyBinding, kDOM };
|
| +// TODO(chongz): Remove after we have moved all 'beforeinput' logic here.
|
| +// https://crbug.com/670035.
|
| +enum class BeforeInputTiming { kHasFiredBeforeCommand, kShouldFireInCommand };
|
|
|
| class EditCommandComposition final : public UndoStep {
|
| public:
|
| @@ -81,8 +84,8 @@ class EditCommandComposition final : public UndoStep {
|
| // * "beforeinput" was canceled, or
|
| // * |frame| was destroyed by event handlers.
|
| // Note: Undo stack will always get popped.
|
| - bool willUnapply(EditCommandSource);
|
| - bool willReapply(EditCommandSource);
|
| + bool willUnapply(EditCommandSource, BeforeInputTiming);
|
| + bool willReapply(EditCommandSource, BeforeInputTiming);
|
|
|
| Member<Document> m_document;
|
| VisibleSelection m_startingSelection;
|
| @@ -100,7 +103,8 @@ class CORE_EXPORT CompositeEditCommand : public EditCommand {
|
| ~CompositeEditCommand() override;
|
|
|
| // Returns |false| if the command failed. e.g. It's aborted.
|
| - bool apply(EditCommandSource);
|
| + bool apply(EditCommandSource,
|
| + BeforeInputTiming = BeforeInputTiming::kHasFiredBeforeCommand);
|
| bool isFirstCommand(EditCommand* command) {
|
| return !m_commands.isEmpty() && m_commands.front() == command;
|
| }
|
| @@ -129,7 +133,7 @@ class CORE_EXPORT CompositeEditCommand : public EditCommand {
|
| // |willApplyEditing()| should be called from
|
| // * |CompositeEditCommand::apply()|, and
|
| // * |TypingCommand::willAddTypingToOpenCommand()|.
|
| - bool willApplyEditing(EditCommandSource);
|
| + bool willApplyEditing(EditCommandSource, BeforeInputTiming);
|
|
|
| //
|
| // sugary-sweet convenience functions to help create and apply edit commands
|
|
|