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 774 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
785 { | 785 { |
786 // If selection has not been set to a custom selection when the command was
created, | 786 // If selection has not been set to a custom selection when the command was
created, |
787 // use the current ending selection. | 787 // use the current ending selection. |
788 if (!m_hasSelectionToDelete) | 788 if (!m_hasSelectionToDelete) |
789 m_selectionToDelete = endingSelection(); | 789 m_selectionToDelete = endingSelection(); |
790 | 790 |
791 if (!m_selectionToDelete.isNonOrphanedRange() || !m_selectionToDelete.isCont
entEditable()) | 791 if (!m_selectionToDelete.isNonOrphanedRange() || !m_selectionToDelete.isCont
entEditable()) |
792 return; | 792 return; |
793 | 793 |
794 // save this to later make the selection with | 794 // save this to later make the selection with |
795 EAffinity affinity = m_selectionToDelete.affinity(); | 795 TextAffinity affinity = m_selectionToDelete.affinity(); |
796 | 796 |
797 Position downstreamEnd = m_selectionToDelete.end().downstream(); | 797 Position downstreamEnd = m_selectionToDelete.end().downstream(); |
798 bool rootWillStayOpenWithoutPlaceholder = downstreamEnd.computeContainerNode
() == downstreamEnd.computeContainerNode()->rootEditableElement() | 798 bool rootWillStayOpenWithoutPlaceholder = downstreamEnd.computeContainerNode
() == downstreamEnd.computeContainerNode()->rootEditableElement() |
799 || (downstreamEnd.computeContainerNode()->isTextNode() && downstreamEnd.
computeContainerNode()->parentNode() == downstreamEnd.computeContainerNode()->ro
otEditableElement()); | 799 || (downstreamEnd.computeContainerNode()->isTextNode() && downstreamEnd.
computeContainerNode()->parentNode() == downstreamEnd.computeContainerNode()->ro
otEditableElement()); |
800 bool lineBreakAtEndOfSelectionToDelete = lineBreakExistsAtVisiblePosition(m_
selectionToDelete.visibleEnd()); | 800 bool lineBreakAtEndOfSelectionToDelete = lineBreakExistsAtVisiblePosition(m_
selectionToDelete.visibleEnd()); |
801 m_needPlaceholder = !rootWillStayOpenWithoutPlaceholder | 801 m_needPlaceholder = !rootWillStayOpenWithoutPlaceholder |
802 && isStartOfParagraph(m_selectionToDelete.visibleStart(), CanCrossEditin
gBoundary) | 802 && isStartOfParagraph(m_selectionToDelete.visibleStart(), CanCrossEditin
gBoundary) |
803 && isEndOfParagraph(m_selectionToDelete.visibleEnd(), CanCrossEditingBou
ndary) | 803 && isEndOfParagraph(m_selectionToDelete.visibleEnd(), CanCrossEditingBou
ndary) |
804 && !lineBreakAtEndOfSelectionToDelete; | 804 && !lineBreakAtEndOfSelectionToDelete; |
805 if (m_needPlaceholder) { | 805 if (m_needPlaceholder) { |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
899 visitor->trace(m_deleteIntoBlockquoteStyle); | 899 visitor->trace(m_deleteIntoBlockquoteStyle); |
900 visitor->trace(m_startRoot); | 900 visitor->trace(m_startRoot); |
901 visitor->trace(m_endRoot); | 901 visitor->trace(m_endRoot); |
902 visitor->trace(m_startTableRow); | 902 visitor->trace(m_startTableRow); |
903 visitor->trace(m_endTableRow); | 903 visitor->trace(m_endTableRow); |
904 visitor->trace(m_temporaryPlaceholder); | 904 visitor->trace(m_temporaryPlaceholder); |
905 CompositeEditCommand::trace(visitor); | 905 CompositeEditCommand::trace(visitor); |
906 } | 906 } |
907 | 907 |
908 } // namespace blink | 908 } // namespace blink |
OLD | NEW |