| 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 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 617 | 617 |
| 618 // m_downstreamEnd's block has been emptied out by deletion. There is no co
ntent inside of it to | 618 // m_downstreamEnd's block has been emptied out by deletion. There is no co
ntent inside of it to |
| 619 // move, so just remove it. | 619 // move, so just remove it. |
| 620 Element* endBlock = enclosingBlock(m_downstreamEnd.deprecatedNode()); | 620 Element* endBlock = enclosingBlock(m_downstreamEnd.deprecatedNode()); |
| 621 if (!endBlock || !endBlock->contains(startOfParagraphToMove.deepEquivalent()
.deprecatedNode()) || !startOfParagraphToMove.deepEquivalent().deprecatedNode())
{ | 621 if (!endBlock || !endBlock->contains(startOfParagraphToMove.deepEquivalent()
.deprecatedNode()) || !startOfParagraphToMove.deepEquivalent().deprecatedNode())
{ |
| 622 removeNode(enclosingBlock(m_downstreamEnd.deprecatedNode())); | 622 removeNode(enclosingBlock(m_downstreamEnd.deprecatedNode())); |
| 623 return; | 623 return; |
| 624 } | 624 } |
| 625 | 625 |
| 626 // We need to merge into m_upstreamStart's block, but it's been emptied out
and collapsed by deletion. | 626 // We need to merge into m_upstreamStart's block, but it's been emptied out
and collapsed by deletion. |
| 627 if (!mergeDestination.deepEquivalent().deprecatedNode() || !mergeDestination
.deepEquivalent().deprecatedNode()->isDescendantOf(enclosingBlock(m_upstreamStar
t.containerNode())) || m_startsAtEmptyLine) { | 627 if (!mergeDestination.deepEquivalent().deprecatedNode() || (!mergeDestinatio
n.deepEquivalent().deprecatedNode()->isDescendantOf(enclosingBlock(m_upstreamSta
rt.containerNode())) && (!mergeDestination.deepEquivalent().anchorNode()->firstC
hild() || !m_upstreamStart.containerNode()->firstChild())) || (m_startsAtEmptyLi
ne && mergeDestination != startOfParagraphToMove)) { |
| 628 insertNodeAt(createBreakElement(document()).get(), m_upstreamStart); | 628 insertNodeAt(createBreakElement(document()).get(), m_upstreamStart); |
| 629 mergeDestination = VisiblePosition(m_upstreamStart); | 629 mergeDestination = VisiblePosition(m_upstreamStart); |
| 630 } | 630 } |
| 631 | 631 |
| 632 if (mergeDestination == startOfParagraphToMove) | 632 if (mergeDestination == startOfParagraphToMove) |
| 633 return; | 633 return; |
| 634 | 634 |
| 635 VisiblePosition endOfParagraphToMove = endOfParagraph(startOfParagraphToMove
); | 635 VisiblePosition endOfParagraphToMove = endOfParagraph(startOfParagraphToMove
); |
| 636 | 636 |
| 637 if (mergeDestination == endOfParagraphToMove) | 637 if (mergeDestination == endOfParagraphToMove) |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 851 | 851 |
| 852 // Normally deletion doesn't preserve the typing style that was present before i
t. For example, | 852 // Normally deletion doesn't preserve the typing style that was present before i
t. For example, |
| 853 // type a character, Bold, then delete the character and start typing. The Bold
typing style shouldn't | 853 // type a character, Bold, then delete the character and start typing. The Bold
typing style shouldn't |
| 854 // stick around. Deletion should preserve a typing style that *it* sets, howeve
r. | 854 // stick around. Deletion should preserve a typing style that *it* sets, howeve
r. |
| 855 bool DeleteSelectionCommand::preservesTypingStyle() const | 855 bool DeleteSelectionCommand::preservesTypingStyle() const |
| 856 { | 856 { |
| 857 return m_typingStyle; | 857 return m_typingStyle; |
| 858 } | 858 } |
| 859 | 859 |
| 860 } // namespace WebCore | 860 } // namespace WebCore |
| OLD | NEW |