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

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

Issue 1690513002: Editing: Pass failure information of RemoveNodeCommand to ReplaceSelectionCommand. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add a comment 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 WillBeHeapVector<RefPtrWillBeMember<Node>> children; 386 WillBeHeapVector<RefPtrWillBeMember<Node>> children;
387 Node* child = NodeTraversal::childAt(*node, from); 387 Node* child = NodeTraversal::childAt(*node, from);
388 for (unsigned i = from; child && i < to; i++, child = child->nextSibling()) 388 for (unsigned i = from; child && i < to; i++, child = child->nextSibling())
389 children.append(child); 389 children.append(child);
390 390
391 size_t size = children.size(); 391 size_t size = children.size();
392 for (size_t i = 0; i < size; ++i) 392 for (size_t i = 0; i < size; ++i)
393 removeNode(children[i].release()); 393 removeNode(children[i].release());
394 } 394 }
395 395
396 void CompositeEditCommand::removeNode(PassRefPtrWillBeRawPtr<Node> node, ShouldA ssumeContentIsAlwaysEditable shouldAssumeContentIsAlwaysEditable) 396 void CompositeEditCommand::removeNode(PassRefPtrWillBeRawPtr<Node> node, Editing State* editingState, ShouldAssumeContentIsAlwaysEditable shouldAssumeContentIsAl waysEditable)
397 { 397 {
398 if (!node || !node->nonShadowBoundaryParentNode()) 398 if (!node || !node->nonShadowBoundaryParentNode())
399 return; 399 return;
400 applyCommandToComposite(RemoveNodeCommand::create(node, shouldAssumeContentI sAlwaysEditable)); 400 ASSERT_IN_EDITING_COMMAND(node->document().frame());
401 applyCommandToComposite(RemoveNodeCommand::create(node, shouldAssumeContentI sAlwaysEditable), editingState);
401 } 402 }
402 403
403 void CompositeEditCommand::removeNodePreservingChildren(PassRefPtrWillBeRawPtr<N ode> node, EditingState* editingState, ShouldAssumeContentIsAlwaysEditable shoul dAssumeContentIsAlwaysEditable) 404 void CompositeEditCommand::removeNodePreservingChildren(PassRefPtrWillBeRawPtr<N ode> node, EditingState* editingState, ShouldAssumeContentIsAlwaysEditable shoul dAssumeContentIsAlwaysEditable)
404 { 405 {
405 ASSERT_IN_EDITING_COMMAND(node->document().frame()); 406 ASSERT_IN_EDITING_COMMAND(node->document().frame());
406 applyCommandToComposite(RemoveNodePreservingChildrenCommand::create(node, sh ouldAssumeContentIsAlwaysEditable)); 407 applyCommandToComposite(RemoveNodePreservingChildrenCommand::create(node, sh ouldAssumeContentIsAlwaysEditable));
407 } 408 }
408 409
409 void CompositeEditCommand::removeNodeAndPruneAncestors(PassRefPtrWillBeRawPtr<No de> node, Node* excludeNode) 410 void CompositeEditCommand::removeNodeAndPruneAncestors(PassRefPtrWillBeRawPtr<No de> node, Node* excludeNode)
410 { 411 {
(...skipping 1107 matching lines...) Expand 10 before | Expand all | Expand 10 after
1518 } 1519 }
1519 1520
1520 DEFINE_TRACE(CompositeEditCommand) 1521 DEFINE_TRACE(CompositeEditCommand)
1521 { 1522 {
1522 visitor->trace(m_commands); 1523 visitor->trace(m_commands);
1523 visitor->trace(m_composition); 1524 visitor->trace(m_composition);
1524 EditCommand::trace(visitor); 1525 EditCommand::trace(visitor);
1525 } 1526 }
1526 1527
1527 } // namespace blink 1528 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698