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

Side by Side Diff: third_party/WebKit/Source/core/editing/commands/RemoveNodePreservingChildrenCommand.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 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 14 matching lines...) Expand all
25 25
26 #include "core/editing/commands/RemoveNodePreservingChildrenCommand.h" 26 #include "core/editing/commands/RemoveNodePreservingChildrenCommand.h"
27 27
28 #include "core/dom/Node.h" 28 #include "core/dom/Node.h"
29 #include "core/editing/EditingUtilities.h" 29 #include "core/editing/EditingUtilities.h"
30 #include "wtf/Assertions.h" 30 #include "wtf/Assertions.h"
31 31
32 namespace blink { 32 namespace blink {
33 33
34 RemoveNodePreservingChildrenCommand::RemoveNodePreservingChildrenCommand( 34 RemoveNodePreservingChildrenCommand::RemoveNodePreservingChildrenCommand(
35 CommandSource source,
35 Node* node, 36 Node* node,
36 ShouldAssumeContentIsAlwaysEditable shouldAssumeContentIsAlwaysEditable) 37 ShouldAssumeContentIsAlwaysEditable shouldAssumeContentIsAlwaysEditable)
37 : CompositeEditCommand(node->document()), 38 : CompositeEditCommand(node->document(), source),
38 m_node(node), 39 m_node(node),
39 m_shouldAssumeContentIsAlwaysEditable( 40 m_shouldAssumeContentIsAlwaysEditable(
40 shouldAssumeContentIsAlwaysEditable) { 41 shouldAssumeContentIsAlwaysEditable) {
41 DCHECK(m_node); 42 DCHECK(m_node);
42 } 43 }
43 44
44 void RemoveNodePreservingChildrenCommand::doApply(EditingState* editingState) { 45 void RemoveNodePreservingChildrenCommand::doApply(EditingState* editingState) {
45 ABORT_EDITING_COMMAND_IF(!m_node->parentNode()); 46 ABORT_EDITING_COMMAND_IF(!m_node->parentNode());
46 ABORT_EDITING_COMMAND_IF(!hasEditableStyle(*m_node->parentNode())); 47 ABORT_EDITING_COMMAND_IF(!hasEditableStyle(*m_node->parentNode()));
47 if (m_node->isContainerNode()) { 48 if (m_node->isContainerNode()) {
(...skipping 13 matching lines...) Expand all
61 } 62 }
62 removeNode(m_node, editingState, m_shouldAssumeContentIsAlwaysEditable); 63 removeNode(m_node, editingState, m_shouldAssumeContentIsAlwaysEditable);
63 } 64 }
64 65
65 DEFINE_TRACE(RemoveNodePreservingChildrenCommand) { 66 DEFINE_TRACE(RemoveNodePreservingChildrenCommand) {
66 visitor->trace(m_node); 67 visitor->trace(m_node);
67 CompositeEditCommand::trace(visitor); 68 CompositeEditCommand::trace(visitor);
68 } 69 }
69 70
70 } // namespace blink 71 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698