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

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

Issue 2610063008: [InputEvent] Introduce temporary flag |BeforeInputTiming| (1/11) (Closed)
Patch Set: Created 3 years, 11 months 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.cpp
diff --git a/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp b/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp
index 866d02dfe99734e203c106c3f9c8b144b4f294f3..007db2918c2625ba6ae8457123a26191281eaab7 100644
--- a/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp
@@ -107,7 +107,7 @@ void EditCommandComposition::unapply(EditCommandSource source) {
LocalFrame* frame = m_document->frame();
DCHECK(frame);
- if (!willUnapply(source))
+ if (!willUnapply(source, BeforeInputTiming::kHasFiredBeforeCommand))
return;
// Changes to the document may have been made since the last editing operation
@@ -131,7 +131,7 @@ void EditCommandComposition::reapply(EditCommandSource source) {
LocalFrame* frame = m_document->frame();
DCHECK(frame);
- if (!willReapply(source))
+ if (!willReapply(source, BeforeInputTiming::kHasFiredBeforeCommand))
return;
// Changes to the document may have been made since the last editing operation
@@ -149,12 +149,12 @@ void EditCommandComposition::reapply(EditCommandSource source) {
frame->editor().reappliedEditing(this);
}
-bool EditCommandComposition::willUnapply(EditCommandSource) {
+bool EditCommandComposition::willUnapply(EditCommandSource, BeforeInputTiming) {
// TODO(chongz): Fire 'beforeinput' for 'historyUndo'.
return true;
}
-bool EditCommandComposition::willReapply(EditCommandSource) {
+bool EditCommandComposition::willReapply(EditCommandSource, BeforeInputTiming) {
// TODO(chongz): Fire 'beforeinput' for 'historyRedo'.
return true;
}
@@ -196,7 +196,8 @@ CompositeEditCommand::~CompositeEditCommand() {
DCHECK(isTopLevelCommand() || !m_composition);
}
-bool CompositeEditCommand::apply(EditCommandSource source) {
+bool CompositeEditCommand::apply(EditCommandSource source,
+ BeforeInputTiming beforeInputTiming) {
DCHECK(!isCommandGroupWrapper());
if (!endingSelection().isContentRichlyEditable()) {
switch (inputType()) {
@@ -232,7 +233,7 @@ bool CompositeEditCommand::apply(EditCommandSource source) {
// the creation of VisiblePositions).
document().updateStyleAndLayoutIgnorePendingStylesheets();
- if (!willApplyEditing(source))
+ if (!willApplyEditing(source, beforeInputTiming))
return false;
LocalFrame* frame = document().frame();
@@ -262,7 +263,8 @@ EditCommandComposition* CompositeEditCommand::ensureComposition() {
return command->m_composition.get();
}
-bool CompositeEditCommand::willApplyEditing(EditCommandSource) {
+bool CompositeEditCommand::willApplyEditing(EditCommandSource,
+ BeforeInputTiming) {
// TODO(chongz): Move all the 'beforeinput' dispatching logic here.
return true;
}

Powered by Google App Engine
This is Rietveld 408576698