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

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

Issue 2558643003: [InputEvent] Move 'beforeinput' logic into |CompositeEditCommand::willApplyEditing()| (3/3) (Closed)
Patch Set: Retain the order of firing 'beforeinput' before 'compositionupdate' 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 39ffedf1bb80c08f6a62ab4ebd3e10edd2c36d17..67d0acf6da662fa135a1c7f584eeae47b233f15c 100644
--- a/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.h
+++ b/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.h
@@ -31,6 +31,7 @@
#include "core/editing/commands/EditCommand.h"
#include "core/editing/commands/EditingState.h"
#include "core/editing/commands/UndoStep.h"
+#include "core/events/InputEvent.h"
#include "wtf/Vector.h"
namespace blink {
@@ -48,13 +49,11 @@ class EditCommandComposition final : public UndoStep {
public:
static EditCommandComposition* create(Document*,
const VisibleSelection&,
- const VisibleSelection&,
- InputEvent::InputType);
+ const VisibleSelection&);
bool belongsTo(const LocalFrame&) const override;
void unapply(EditCommandSource) override;
void reapply(EditCommandSource) override;
- InputEvent::InputType inputType() const override;
void append(SimpleEditCommand*);
void append(EditCommandComposition*);
@@ -76,10 +75,8 @@ class EditCommandComposition final : public UndoStep {
private:
EditCommandComposition(Document*,
const VisibleSelection& startingSelection,
- const VisibleSelection& endingSelection,
- InputEvent::InputType);
+ const VisibleSelection& endingSelection);
- // TODO(chongz): Implement "beforeinput" as described below:
// Fires "beforeinput" and will returns |false| to cancel unapply / reapply if
Xiaocheng 2016/12/20 05:49:57 nit: s/returns/return/
chongz 2016/12/20 23:27:51 Done.
// * "beforeinput" was canceled, or
// * |frame| was destroyed by event handlers.
@@ -93,7 +90,6 @@ class EditCommandComposition final : public UndoStep {
HeapVector<Member<SimpleEditCommand>> m_commands;
Member<Element> m_startingRootEditableElement;
Member<Element> m_endingRootEditableElement;
- InputEvent::InputType m_inputType;
};
class CORE_EXPORT CompositeEditCommand : public EditCommand {
@@ -121,12 +117,17 @@ class CORE_EXPORT CompositeEditCommand : public EditCommand {
virtual void setShouldRetainAutocorrectionIndicator(bool);
virtual bool shouldStopCaretBlinking() const { return false; }
+ virtual InputEvent::InputType inputType() const;
+ // |TypingCommand| will return the text of the last |m_commands|.
+ virtual String textDataForInputEvent() const;
+ virtual DataTransfer* dataTransferForInputEvent() const;
+ virtual RangeVector* targetRangesForInputEvent() const;
+
DECLARE_VIRTUAL_TRACE();
protected:
explicit CompositeEditCommand(Document&);
- // TODO(chongz): Implement "beforeinput" as described below:
// Fires "beforeinput" and will return |false| to cancel applying editing if
// * "beforeinput" was canceled, or
// * |frame| was destroyed by event handlers.

Powered by Google App Engine
This is Rietveld 408576698