| 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 1004 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1015 m_referenceMovePosition = Position(); | 1015 m_referenceMovePosition = Position(); |
| 1016 } | 1016 } |
| 1017 | 1017 |
| 1018 // This method removes div elements with no attributes that have only one child | 1018 // This method removes div elements with no attributes that have only one child |
| 1019 // or no children at all. | 1019 // or no children at all. |
| 1020 void DeleteSelectionCommand::removeRedundantBlocks(EditingState* editingState) { | 1020 void DeleteSelectionCommand::removeRedundantBlocks(EditingState* editingState) { |
| 1021 Node* node = m_endingPosition.computeContainerNode(); | 1021 Node* node = m_endingPosition.computeContainerNode(); |
| 1022 Element* rootElement = rootEditableElement(*node); | 1022 Element* rootElement = rootEditableElement(*node); |
| 1023 | 1023 |
| 1024 while (node != rootElement) { | 1024 while (node != rootElement) { |
| 1025 ABORT_EDITING_COMMAND_IF(!node); |
| 1025 if (isRemovableBlock(node)) { | 1026 if (isRemovableBlock(node)) { |
| 1026 if (node == m_endingPosition.anchorNode()) | 1027 if (node == m_endingPosition.anchorNode()) |
| 1027 updatePositionForNodeRemovalPreservingChildren(m_endingPosition, *node); | 1028 updatePositionForNodeRemovalPreservingChildren(m_endingPosition, *node); |
| 1028 | 1029 |
| 1029 CompositeEditCommand::removeNodePreservingChildren(node, editingState); | 1030 CompositeEditCommand::removeNodePreservingChildren(node, editingState); |
| 1030 if (editingState->isAborted()) | 1031 if (editingState->isAborted()) |
| 1031 return; | 1032 return; |
| 1032 node = m_endingPosition.anchorNode(); | 1033 node = m_endingPosition.anchorNode(); |
| 1033 } else { | 1034 } else { |
| 1034 node = node->parentNode(); | 1035 node = node->parentNode(); |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1226 visitor->trace(m_deleteIntoBlockquoteStyle); | 1227 visitor->trace(m_deleteIntoBlockquoteStyle); |
| 1227 visitor->trace(m_startRoot); | 1228 visitor->trace(m_startRoot); |
| 1228 visitor->trace(m_endRoot); | 1229 visitor->trace(m_endRoot); |
| 1229 visitor->trace(m_startTableRow); | 1230 visitor->trace(m_startTableRow); |
| 1230 visitor->trace(m_endTableRow); | 1231 visitor->trace(m_endTableRow); |
| 1231 visitor->trace(m_temporaryPlaceholder); | 1232 visitor->trace(m_temporaryPlaceholder); |
| 1232 CompositeEditCommand::trace(visitor); | 1233 CompositeEditCommand::trace(visitor); |
| 1233 } | 1234 } |
| 1234 | 1235 |
| 1235 } // namespace blink | 1236 } // namespace blink |
| OLD | NEW |