OLD | NEW |
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 Loading... |
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 |
OLD | NEW |