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

Side by Side Diff: third_party/WebKit/Source/core/editing/commands/SimplifyMarkupCommand.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
« no previous file with comments | « third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2012 Apple Computer, 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 } 106 }
107 107
108 ContainerNode* highestAncestorToRemove = nodesToRemove[pastLastNodeToRemove - 1].get(); 108 ContainerNode* highestAncestorToRemove = nodesToRemove[pastLastNodeToRemove - 1].get();
109 RefPtrWillBeRawPtr<ContainerNode> parent = highestAncestorToRemove->parentNo de(); 109 RefPtrWillBeRawPtr<ContainerNode> parent = highestAncestorToRemove->parentNo de();
110 if (!parent) // Parent has already been removed. 110 if (!parent) // Parent has already been removed.
111 return -1; 111 return -1;
112 112
113 if (pastLastNodeToRemove == startNodeIndex + 1) 113 if (pastLastNodeToRemove == startNodeIndex + 1)
114 return 0; 114 return 0;
115 115
116 removeNode(nodesToRemove[startNodeIndex], AssumeContentIsAlwaysEditable); 116 removeNode(nodesToRemove[startNodeIndex], ASSERT_NO_EDITING_ABORT, AssumeCon tentIsAlwaysEditable);
117 insertNodeBefore(nodesToRemove[startNodeIndex], highestAncestorToRemove, Ass umeContentIsAlwaysEditable); 117 insertNodeBefore(nodesToRemove[startNodeIndex], highestAncestorToRemove, Ass umeContentIsAlwaysEditable);
118 removeNode(highestAncestorToRemove, AssumeContentIsAlwaysEditable); 118 removeNode(highestAncestorToRemove, ASSERT_NO_EDITING_ABORT, AssumeContentIs AlwaysEditable);
119 119
120 return pastLastNodeToRemove - startNodeIndex - 1; 120 return pastLastNodeToRemove - startNodeIndex - 1;
121 } 121 }
122 122
123 DEFINE_TRACE(SimplifyMarkupCommand) 123 DEFINE_TRACE(SimplifyMarkupCommand)
124 { 124 {
125 visitor->trace(m_firstNode); 125 visitor->trace(m_firstNode);
126 visitor->trace(m_nodeAfterLast); 126 visitor->trace(m_nodeAfterLast);
127 CompositeEditCommand::trace(visitor); 127 CompositeEditCommand::trace(visitor);
128 } 128 }
129 129
130 } // namespace blink 130 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698