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 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
628 | 628 |
629 VisiblePosition endOfParagraphToMove = endOfParagraph(startOfParagraphToMove
, CanSkipOverEditingBoundary); | 629 VisiblePosition endOfParagraphToMove = endOfParagraph(startOfParagraphToMove
, CanSkipOverEditingBoundary); |
630 | 630 |
631 if (mergeDestination == endOfParagraphToMove) | 631 if (mergeDestination == endOfParagraphToMove) |
632 return; | 632 return; |
633 | 633 |
634 // If the merge destination and source to be moved are both list items of di
fferent lists, merge them into single list. | 634 // If the merge destination and source to be moved are both list items of di
fferent lists, merge them into single list. |
635 Node* listItemInFirstParagraph = enclosingNodeOfType(m_upstreamStart, isList
Item); | 635 Node* listItemInFirstParagraph = enclosingNodeOfType(m_upstreamStart, isList
Item); |
636 Node* listItemInSecondParagraph = enclosingNodeOfType(m_downstreamEnd, isLis
tItem); | 636 Node* listItemInSecondParagraph = enclosingNodeOfType(m_downstreamEnd, isLis
tItem); |
637 if (listItemInFirstParagraph && listItemInSecondParagraph | 637 if (listItemInFirstParagraph && listItemInSecondParagraph |
| 638 && listItemInFirstParagraph->parentElement() != listItemInSecondParagrap
h->parentElement() |
638 && canMergeLists(listItemInFirstParagraph->parentElement(), listItemInSe
condParagraph->parentElement())) { | 639 && canMergeLists(listItemInFirstParagraph->parentElement(), listItemInSe
condParagraph->parentElement())) { |
639 mergeIdenticalElements(listItemInFirstParagraph->parentElement(), listIt
emInSecondParagraph->parentElement()); | 640 mergeIdenticalElements(listItemInFirstParagraph->parentElement(), listIt
emInSecondParagraph->parentElement()); |
640 m_endingPosition = mergeDestination.deepEquivalent(); | 641 m_endingPosition = mergeDestination.deepEquivalent(); |
641 return; | 642 return; |
642 } | 643 } |
643 | 644 |
644 // The rule for merging into an empty block is: only do so if its farther to
the right. | 645 // The rule for merging into an empty block is: only do so if its farther to
the right. |
645 // FIXME: Consider RTL. | 646 // FIXME: Consider RTL. |
646 if (!m_startsAtEmptyLine && isStartOfParagraph(mergeDestination) && startOfP
aragraphToMove.absoluteCaretBounds().x() > mergeDestination.absoluteCaretBounds(
).x()) { | 647 if (!m_startsAtEmptyLine && isStartOfParagraph(mergeDestination) && startOfP
aragraphToMove.absoluteCaretBounds().x() > mergeDestination.absoluteCaretBounds(
).x()) { |
647 if (isHTMLBRElement(*mergeDestination.deepEquivalent().downstream().depr
ecatedNode())) { | 648 if (isHTMLBRElement(*mergeDestination.deepEquivalent().downstream().depr
ecatedNode())) { |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
857 | 858 |
858 // Normally deletion doesn't preserve the typing style that was present before i
t. For example, | 859 // Normally deletion doesn't preserve the typing style that was present before i
t. For example, |
859 // type a character, Bold, then delete the character and start typing. The Bold
typing style shouldn't | 860 // type a character, Bold, then delete the character and start typing. The Bold
typing style shouldn't |
860 // stick around. Deletion should preserve a typing style that *it* sets, howeve
r. | 861 // stick around. Deletion should preserve a typing style that *it* sets, howeve
r. |
861 bool DeleteSelectionCommand::preservesTypingStyle() const | 862 bool DeleteSelectionCommand::preservesTypingStyle() const |
862 { | 863 { |
863 return m_typingStyle; | 864 return m_typingStyle; |
864 } | 865 } |
865 | 866 |
866 } // namespace WebCore | 867 } // namespace WebCore |
OLD | NEW |