Chromium Code Reviews| 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 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 651 // m_downstreamEnd's block has been emptied out by deletion. There is no co ntent inside of it to | 651 // m_downstreamEnd's block has been emptied out by deletion. There is no co ntent inside of it to |
| 652 // move, so just remove it. | 652 // move, so just remove it. |
| 653 Element* endBlock = enclosingBlock(m_downstreamEnd.anchorNode()); | 653 Element* endBlock = enclosingBlock(m_downstreamEnd.anchorNode()); |
| 654 if (!endBlock || !endBlock->contains(startOfParagraphToMove.deepEquivalent() .anchorNode()) || !startOfParagraphToMove.deepEquivalent().anchorNode()) { | 654 if (!endBlock || !endBlock->contains(startOfParagraphToMove.deepEquivalent() .anchorNode()) || !startOfParagraphToMove.deepEquivalent().anchorNode()) { |
| 655 removeNode(enclosingBlock(m_downstreamEnd.anchorNode()), editingState); | 655 removeNode(enclosingBlock(m_downstreamEnd.anchorNode()), editingState); |
| 656 return; | 656 return; |
| 657 } | 657 } |
| 658 | 658 |
| 659 // We need to merge into m_upstreamStart's block, but it's been emptied out and collapsed by deletion. | 659 // We need to merge into m_upstreamStart's block, but it's been emptied out and collapsed by deletion. |
| 660 if (!mergeDestination.deepEquivalent().anchorNode() || (!mergeDestination.de epEquivalent().anchorNode()->isDescendantOf(enclosingBlock(m_upstreamStart.compu teContainerNode())) && (!mergeDestination.deepEquivalent().anchorNode()->hasChil dren() || !m_upstreamStart.computeContainerNode()->hasChildren())) || (m_startsA tEmptyLine && mergeDestination.deepEquivalent() != startOfParagraphToMove.deepEq uivalent())) { | 660 if (!mergeDestination.deepEquivalent().anchorNode() || (!mergeDestination.de epEquivalent().anchorNode()->isDescendantOf(enclosingBlock(m_upstreamStart.compu teContainerNode())) && (!mergeDestination.deepEquivalent().anchorNode()->hasChil dren() || !m_upstreamStart.computeContainerNode()->hasChildren())) || (m_startsA tEmptyLine && mergeDestination.deepEquivalent() != startOfParagraphToMove.deepEq uivalent())) { |
| 661 PositionWithAffinity storedStartOfParagraphToMove = startOfParagraphToMo ve.toPositionWithAffinity(); | |
| 661 insertNodeAt(HTMLBRElement::create(document()), m_upstreamStart, editing State); | 662 insertNodeAt(HTMLBRElement::create(document()), m_upstreamStart, editing State); |
| 662 if (editingState->isAborted()) | 663 if (editingState->isAborted()) |
| 663 return; | 664 return; |
| 664 mergeDestination = createVisiblePositionDeprecated(m_upstreamStart); | 665 mergeDestination = createVisiblePositionDeprecated(m_upstreamStart); |
| 666 startOfParagraphToMove = createVisiblePosition(storedStartOfParagraphToM ove); | |
|
yosin_UTC9
2016/09/28 01:24:06
Rational of converting VP:
|startOfParagraphToMove
| |
| 665 } | 667 } |
| 666 | 668 |
| 667 if (mergeDestination.deepEquivalent() == startOfParagraphToMove.deepEquivale nt()) | 669 if (mergeDestination.deepEquivalent() == startOfParagraphToMove.deepEquivale nt()) |
| 668 return; | 670 return; |
| 669 | 671 |
| 670 VisiblePosition endOfParagraphToMove = endOfParagraphDeprecated(startOfParag raphToMove, CanSkipOverEditingBoundary); | 672 VisiblePosition endOfParagraphToMove = endOfParagraphDeprecated(startOfParag raphToMove, CanSkipOverEditingBoundary); |
| 671 | 673 |
| 672 if (mergeDestination.deepEquivalent() == endOfParagraphToMove.deepEquivalent ()) | 674 if (mergeDestination.deepEquivalent() == endOfParagraphToMove.deepEquivalent ()) |
| 673 return; | 675 return; |
| 674 | 676 |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 963 visitor->trace(m_deleteIntoBlockquoteStyle); | 965 visitor->trace(m_deleteIntoBlockquoteStyle); |
| 964 visitor->trace(m_startRoot); | 966 visitor->trace(m_startRoot); |
| 965 visitor->trace(m_endRoot); | 967 visitor->trace(m_endRoot); |
| 966 visitor->trace(m_startTableRow); | 968 visitor->trace(m_startTableRow); |
| 967 visitor->trace(m_endTableRow); | 969 visitor->trace(m_endTableRow); |
| 968 visitor->trace(m_temporaryPlaceholder); | 970 visitor->trace(m_temporaryPlaceholder); |
| 969 CompositeEditCommand::trace(visitor); | 971 CompositeEditCommand::trace(visitor); |
| 970 } | 972 } |
| 971 | 973 |
| 972 } // namespace blink | 974 } // namespace blink |
| OLD | NEW |