| 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..0ce7b44abcf6679e036212e8c6748b4696cf298e 100644
|
| --- a/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp
|
| +++ b/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp
|
| @@ -189,14 +189,15 @@ DEFINE_TRACE(EditCommandComposition) {
|
| UndoStep::trace(visitor);
|
| }
|
|
|
| -CompositeEditCommand::CompositeEditCommand(Document& document)
|
| - : EditCommand(document) {}
|
| +CompositeEditCommand::CompositeEditCommand(Document& document,
|
| + EditCommandSource source)
|
| + : EditCommand(document), m_source(source) {}
|
|
|
| CompositeEditCommand::~CompositeEditCommand() {
|
| DCHECK(isTopLevelCommand() || !m_composition);
|
| }
|
|
|
| -bool CompositeEditCommand::apply(EditCommandSource source) {
|
| +bool CompositeEditCommand::apply() {
|
| 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(m_source))
|
| return false;
|
|
|
| LocalFrame* frame = document().frame();
|
| @@ -333,7 +334,8 @@ void CompositeEditCommand::appendCommandToComposite(
|
| void CompositeEditCommand::applyStyle(const EditingStyle* style,
|
| EditingState* editingState) {
|
| applyCommandToComposite(
|
| - ApplyStyleCommand::create(document(), style, InputEvent::InputType::None),
|
| + ApplyStyleCommand::create(document(), EditCommandSource::kInternal, style,
|
| + InputEvent::InputType::None),
|
| editingState);
|
| }
|
|
|
| @@ -757,11 +759,13 @@ void CompositeEditCommand::deleteSelection(EditingState* editingState,
|
| bool mergeBlocksAfterDelete,
|
| bool expandForSpecialElements,
|
| bool sanitizeMarkup) {
|
| - if (endingSelection().isRange())
|
| - applyCommandToComposite(DeleteSelectionCommand::create(
|
| - document(), smartDelete, mergeBlocksAfterDelete,
|
| - expandForSpecialElements, sanitizeMarkup),
|
| - editingState);
|
| + if (endingSelection().isRange()) {
|
| + applyCommandToComposite(
|
| + DeleteSelectionCommand::create(
|
| + document(), EditCommandSource::kInternal, smartDelete,
|
| + mergeBlocksAfterDelete, expandForSpecialElements, sanitizeMarkup),
|
| + editingState);
|
| + }
|
| }
|
|
|
| void CompositeEditCommand::deleteSelection(const VisibleSelection& selection,
|
| @@ -1686,7 +1690,8 @@ void CompositeEditCommand::moveParagraphs(
|
| if (shouldPreserveStyle == DoNotPreserveStyle)
|
| options |= ReplaceSelectionCommand::MatchStyle;
|
| applyCommandToComposite(
|
| - ReplaceSelectionCommand::create(document(), fragment, options),
|
| + ReplaceSelectionCommand::create(document(), EditCommandSource::kInternal,
|
| + fragment, options),
|
| editingState);
|
| if (editingState->isAborted())
|
| return;
|
|
|