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

Unified Diff: third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.h

Issue 2583993002: [Editing] Introduce |CompositeEditCommand::willApplyEditing()| in prepare for 'beforeinput' (1/3) (Closed)
Patch Set: 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/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 f2d7317eeca7d2291063530eaefa637e55976300..9cdbada94423cfaf763554b716e6c9e8e4a6ff5e 100644
--- a/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.h
+++ b/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.h
@@ -118,6 +118,14 @@ class CORE_EXPORT CompositeEditCommand : public EditCommand {
protected:
explicit CompositeEditCommand(Document&);
+ // Fires "beforeinput", returns |false| to cancel applying editing if
+ // * "beforeinput" was canceled, or
+ // * |frame| was destroyed by event handlers.
+ // |willApplyEditing()| should be called from
+ // * |CompositeEditCommand::willApply()|, and
+ // * |TypingCommand::willAddTypingToOpenCommand()|.
+ bool willApplyEditing(EditCommandSource);
Xiaocheng 2016/12/19 03:33:57 Please add a TODO: implementation note here since
chongz 2016/12/19 06:48:57 Will do.
chongz 2016/12/19 20:55:22 Done.
+
//
// sugary-sweet convenience functions to help create and apply edit commands
// in composite commands
@@ -265,6 +273,9 @@ class CORE_EXPORT CompositeEditCommand : public EditCommand {
HeapVector<Member<EditCommand>> m_commands;
private:
+ // Returns |false| to cancel applying command.
+ bool willApply(EditCommandSource);
+
bool isCompositeEditCommand() const final { return true; }
Member<EditCommandComposition> m_composition;

Powered by Google App Engine
This is Rietveld 408576698