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

Side by Side Diff: Source/core/editing/BreakBlockquoteCommand.cpp

Issue 419313002: Use tighter typing in editing: BreakBlockquoteCommand & Caret (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/core/editing/Caret.h » ('j') | 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) 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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 // This is so we can clone ancestor's siblings and place the clones 166 // This is so we can clone ancestor's siblings and place the clones
167 // into the clone corresponding to the ancestor's parent. 167 // into the clone corresponding to the ancestor's parent.
168 RefPtrWillBeRawPtr<Element> ancestor = nullptr; 168 RefPtrWillBeRawPtr<Element> ancestor = nullptr;
169 RefPtrWillBeRawPtr<Element> clonedParent = nullptr; 169 RefPtrWillBeRawPtr<Element> clonedParent = nullptr;
170 for (ancestor = ancestors.first(), clonedParent = clonedAncestor->parent Element(); 170 for (ancestor = ancestors.first(), clonedParent = clonedAncestor->parent Element();
171 ancestor && ancestor != topBlockquote; 171 ancestor && ancestor != topBlockquote;
172 ancestor = ancestor->parentElement(), clonedParent = clonedParent-> parentElement()) 172 ancestor = ancestor->parentElement(), clonedParent = clonedParent-> parentElement())
173 moveRemainingSiblingsToNewParent(ancestor->nextSibling(), 0, clonedP arent); 173 moveRemainingSiblingsToNewParent(ancestor->nextSibling(), 0, clonedP arent);
174 174
175 // If the startNode's original parent is now empty, remove it 175 // If the startNode's original parent is now empty, remove it
176 Node* originalParent = ancestors.first().get(); 176 Element* originalParent = ancestors.first().get();
177 if (!originalParent->hasChildren()) 177 if (!originalParent->hasChildren())
178 removeNode(originalParent); 178 removeNode(originalParent);
179 } 179 }
180 180
181 // Make sure the cloned block quote renders. 181 // Make sure the cloned block quote renders.
182 addBlockPlaceholderIfNeeded(clonedBlockquote.get()); 182 addBlockPlaceholderIfNeeded(clonedBlockquote.get());
183 183
184 // Put the selection right before the break. 184 // Put the selection right before the break.
185 setEndingSelection(VisibleSelection(positionBeforeNode(breakNode.get()), DOW NSTREAM, endingSelection().isDirectional())); 185 setEndingSelection(VisibleSelection(positionBeforeNode(breakNode.get()), DOW NSTREAM, endingSelection().isDirectional()));
186 rebalanceWhitespace(); 186 rebalanceWhitespace();
187 } 187 }
188 188
189 } // namespace blink 189 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/core/editing/Caret.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698