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

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

Issue 1695153002: Editing: Make the |EditingState*| argument of CompositeEditCommand::removeNode mandatory. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ; Created 4 years, 10 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/BreakBlockquoteCommand.cpp
diff --git a/third_party/WebKit/Source/core/editing/commands/BreakBlockquoteCommand.cpp b/third_party/WebKit/Source/core/editing/commands/BreakBlockquoteCommand.cpp
index cea74931a37fef879bbb5b1e1fef9b153d7a79a8..b7bc276d83db91929463a97262f547b1880761c1 100644
--- a/third_party/WebKit/Source/core/editing/commands/BreakBlockquoteCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/BreakBlockquoteCommand.cpp
@@ -72,14 +72,17 @@ BreakBlockquoteCommand::BreakBlockquoteCommand(Document& document)
{
}
-void BreakBlockquoteCommand::doApply(EditingState*)
+void BreakBlockquoteCommand::doApply(EditingState* editingState)
{
if (endingSelection().isNone())
return;
// Delete the current selection.
- if (endingSelection().isRange())
- deleteSelection(ASSERT_NO_EDITING_ABORT, false, false);
+ if (endingSelection().isRange()) {
+ deleteSelection(editingState, false, false);
+ if (editingState->isAborted())
+ return;
+ }
// This is a scenario that should never happen, but we want to
// make sure we don't dereference a null pointer below.
@@ -191,11 +194,15 @@ void BreakBlockquoteCommand::doApply(EditingState*)
setNodeAttribute(clonedChild, startAttr, AtomicString::number(toLayoutListItem(listChildNode->layoutObject())->value()));
}
- appendNode(clonedChild.get(), clonedAncestor.get());
+ appendNode(clonedChild.get(), clonedAncestor.get(), editingState);
+ if (editingState->isAborted())
+ return;
clonedAncestor = clonedChild;
}
- moveRemainingSiblingsToNewParent(startNode, 0, clonedAncestor);
+ moveRemainingSiblingsToNewParent(startNode, 0, clonedAncestor, editingState);
+ if (editingState->isAborted())
+ return;
if (!ancestors.isEmpty()) {
// Split the tree up the ancestor chain until the topBlockquote
@@ -206,13 +213,19 @@ void BreakBlockquoteCommand::doApply(EditingState*)
RefPtrWillBeRawPtr<Element> clonedParent = nullptr;
for (ancestor = ancestors.first(), clonedParent = clonedAncestor->parentElement();
ancestor && ancestor != topBlockquote;
- ancestor = ancestor->parentElement(), clonedParent = clonedParent->parentElement())
- moveRemainingSiblingsToNewParent(ancestor->nextSibling(), 0, clonedParent);
+ ancestor = ancestor->parentElement(), clonedParent = clonedParent->parentElement()) {
+ moveRemainingSiblingsToNewParent(ancestor->nextSibling(), 0, clonedParent, editingState);
+ if (editingState->isAborted())
+ return;
+ }
// If the startNode's original parent is now empty, remove it
Element* originalParent = ancestors.first().get();
- if (!originalParent->hasChildren())
- removeNode(originalParent);
+ if (!originalParent->hasChildren()) {
+ removeNode(originalParent, editingState);
+ if (editingState->isAborted())
+ return;
+ }
}
// Make sure the cloned block quote renders.

Powered by Google App Engine
This is Rietveld 408576698