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

Side by Side Diff: third_party/WebKit/Source/core/editing/commands/RemoveNodePreservingChildrenCommand.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, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2005, 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 28 matching lines...) Expand all
39 } 39 }
40 40
41 void RemoveNodePreservingChildrenCommand::doApply(EditingState*) 41 void RemoveNodePreservingChildrenCommand::doApply(EditingState*)
42 { 42 {
43 if (m_node->isContainerNode()) { 43 if (m_node->isContainerNode()) {
44 NodeVector children; 44 NodeVector children;
45 getChildNodes(toContainerNode(*m_node), children); 45 getChildNodes(toContainerNode(*m_node), children);
46 46
47 for (auto& currentChild : children) { 47 for (auto& currentChild : children) {
48 RefPtrWillBeRawPtr<Node> child = currentChild.release(); 48 RefPtrWillBeRawPtr<Node> child = currentChild.release();
49 removeNode(child, m_shouldAssumeContentIsAlwaysEditable); 49 removeNode(child, ASSERT_NO_EDITING_ABORT, m_shouldAssumeContentIsAl waysEditable);
50 insertNodeBefore(child.release(), m_node, m_shouldAssumeContentIsAlw aysEditable); 50 insertNodeBefore(child.release(), m_node, m_shouldAssumeContentIsAlw aysEditable);
51 } 51 }
52 } 52 }
53 removeNode(m_node, m_shouldAssumeContentIsAlwaysEditable); 53 removeNode(m_node, ASSERT_NO_EDITING_ABORT, m_shouldAssumeContentIsAlwaysEdi table);
54 } 54 }
55 55
56 DEFINE_TRACE(RemoveNodePreservingChildrenCommand) 56 DEFINE_TRACE(RemoveNodePreservingChildrenCommand)
57 { 57 {
58 visitor->trace(m_node); 58 visitor->trace(m_node);
59 CompositeEditCommand::trace(visitor); 59 CompositeEditCommand::trace(visitor);
60 } 60 }
61 61
62 } // namespace blink 62 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698