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

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

Issue 2574793002: [Editing] Store |CommandSource| in |CompositeEditCommand| (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/ReplaceSelectionCommand.cpp
diff --git a/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp b/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp
index 3ec32c20dbe3f857bd7d8470f0e0515ccf86399e..f6f675b94669412525f23ed5088f1629c271560d 100644
--- a/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp
@@ -438,10 +438,11 @@ inline void ReplaceSelectionCommand::InsertedNodes::didReplaceNode(
ReplaceSelectionCommand::ReplaceSelectionCommand(
Document& document,
+ CommandSource source,
DocumentFragment* fragment,
CommandOptions options,
InputEvent::InputType inputType)
- : CompositeEditCommand(document),
+ : CompositeEditCommand(document, source),
m_selectReplacement(options & SelectReplacement),
m_smartReplace(options & SmartReplace),
m_matchStyle(options & MatchStyle),
@@ -1279,8 +1280,9 @@ void ReplaceSelectionCommand::doApply(EditingState* editingState) {
CanCrossEditingBoundary) &&
m_preventNesting &&
!(enclosingNodeOfType(insertionPos, &isTableStructureNode))) {
- applyCommandToComposite(BreakBlockquoteCommand::create(document()),
- editingState);
+ applyCommandToComposite(
+ BreakBlockquoteCommand::create(document(), commandSource()),
+ editingState);
if (editingState->isAborted())
return;
// This will leave a br between the split.
@@ -1544,10 +1546,11 @@ void ReplaceSelectionCommand::doApply(EditingState* editingState) {
}
if (m_sanitizeFragment && insertedNodes.firstNodeInserted()) {
- applyCommandToComposite(SimplifyMarkupCommand::create(
- document(), insertedNodes.firstNodeInserted(),
- insertedNodes.pastLastLeaf()),
- editingState);
+ applyCommandToComposite(
+ SimplifyMarkupCommand::create(document(), commandSource(),
+ insertedNodes.firstNodeInserted(),
+ insertedNodes.pastLastLeaf()),
+ editingState);
if (editingState->isAborted())
return;
}

Powered by Google App Engine
This is Rietveld 408576698