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

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

Issue 2571953004: Migrate WTF::Vector::append() to ::push_back() [part 5 of N] (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 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2005 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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 .setIsDirectional(endingSelection().isDirectional()) 188 .setIsDirectional(endingSelection().isDirectional())
189 .build()); 189 .build());
190 return; 190 return;
191 } 191 }
192 192
193 // Build up list of ancestors in between the start node and the top 193 // Build up list of ancestors in between the start node and the top
194 // blockquote. 194 // blockquote.
195 HeapVector<Member<Element>> ancestors; 195 HeapVector<Member<Element>> ancestors;
196 for (Element* node = startNode->parentElement(); 196 for (Element* node = startNode->parentElement();
197 node && node != topBlockquote; node = node->parentElement()) 197 node && node != topBlockquote; node = node->parentElement())
198 ancestors.append(node); 198 ancestors.push_back(node);
199 199
200 // Insert a clone of the top blockquote after the break. 200 // Insert a clone of the top blockquote after the break.
201 Element* clonedBlockquote = topBlockquote->cloneElementWithoutChildren(); 201 Element* clonedBlockquote = topBlockquote->cloneElementWithoutChildren();
202 insertNodeAfter(clonedBlockquote, breakElement, editingState); 202 insertNodeAfter(clonedBlockquote, breakElement, editingState);
203 if (editingState->isAborted()) 203 if (editingState->isAborted())
204 return; 204 return;
205 205
206 // Clone startNode's ancestors into the cloned blockquote. 206 // Clone startNode's ancestors into the cloned blockquote.
207 // On exiting this loop, clonedAncestor is the lowest ancestor 207 // On exiting this loop, clonedAncestor is the lowest ancestor
208 // that was cloned (i.e. the clone of either ancestors.last() 208 // that was cloned (i.e. the clone of either ancestors.last()
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 268
269 // Put the selection right before the break. 269 // Put the selection right before the break.
270 setEndingSelection(SelectionInDOMTree::Builder() 270 setEndingSelection(SelectionInDOMTree::Builder()
271 .collapse(Position::beforeNode(breakElement)) 271 .collapse(Position::beforeNode(breakElement))
272 .setIsDirectional(endingSelection().isDirectional()) 272 .setIsDirectional(endingSelection().isDirectional())
273 .build()); 273 .build());
274 rebalanceWhitespace(); 274 rebalanceWhitespace();
275 } 275 }
276 276
277 } // namespace blink 277 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698