Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(103)

Side by Side Diff: Source/WebCore/editing/DeleteSelectionCommand.cpp

Issue 10451004: Merge 116653 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1132/
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 561 matching lines...) Expand 10 before | Expand all | Expand 10 after
572 572
573 // There's nothing to merge. 573 // There's nothing to merge.
574 if (m_upstreamStart == m_downstreamEnd) 574 if (m_upstreamStart == m_downstreamEnd)
575 return; 575 return;
576 576
577 VisiblePosition startOfParagraphToMove(m_downstreamEnd); 577 VisiblePosition startOfParagraphToMove(m_downstreamEnd);
578 VisiblePosition mergeDestination(m_upstreamStart); 578 VisiblePosition mergeDestination(m_upstreamStart);
579 579
580 // m_downstreamEnd's block has been emptied out by deletion. There is no co ntent inside of it to 580 // m_downstreamEnd's block has been emptied out by deletion. There is no co ntent inside of it to
581 // move, so just remove it. 581 // move, so just remove it.
582 Element* endBlock = static_cast<Element*>(enclosingBlock(m_downstreamEnd.dep recatedNode())); 582 Element* endBlock = enclosingBlock(m_downstreamEnd.deprecatedNode());
583 if (!endBlock || !endBlock->contains(startOfParagraphToMove.deepEquivalent() .deprecatedNode()) || !startOfParagraphToMove.deepEquivalent().deprecatedNode()) { 583 if (!endBlock || !endBlock->contains(startOfParagraphToMove.deepEquivalent() .deprecatedNode()) || !startOfParagraphToMove.deepEquivalent().deprecatedNode()) {
584 removeNode(enclosingBlock(m_downstreamEnd.deprecatedNode())); 584 removeNode(enclosingBlock(m_downstreamEnd.deprecatedNode()));
585 return; 585 return;
586 } 586 }
587 587
588 // We need to merge into m_upstreamStart's block, but it's been emptied out and collapsed by deletion. 588 // We need to merge into m_upstreamStart's block, but it's been emptied out and collapsed by deletion.
589 if (!mergeDestination.deepEquivalent().deprecatedNode() || !mergeDestination .deepEquivalent().deprecatedNode()->isDescendantOf(enclosingBlock(m_upstreamStar t.containerNode())) || m_startsAtEmptyLine) { 589 if (!mergeDestination.deepEquivalent().deprecatedNode() || !mergeDestination .deepEquivalent().deprecatedNode()->isDescendantOf(enclosingBlock(m_upstreamStar t.containerNode())) || m_startsAtEmptyLine) {
590 insertNodeAt(createBreakElement(document()).get(), m_upstreamStart); 590 insertNodeAt(createBreakElement(document()).get(), m_upstreamStart);
591 mergeDestination = VisiblePosition(m_upstreamStart); 591 mergeDestination = VisiblePosition(m_upstreamStart);
592 } 592 }
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
841 841
842 // Normally deletion doesn't preserve the typing style that was present before i t. For example, 842 // Normally deletion doesn't preserve the typing style that was present before i t. For example,
843 // type a character, Bold, then delete the character and start typing. The Bold typing style shouldn't 843 // type a character, Bold, then delete the character and start typing. The Bold typing style shouldn't
844 // stick around. Deletion should preserve a typing style that *it* sets, howeve r. 844 // stick around. Deletion should preserve a typing style that *it* sets, howeve r.
845 bool DeleteSelectionCommand::preservesTypingStyle() const 845 bool DeleteSelectionCommand::preservesTypingStyle() const
846 { 846 {
847 return m_typingStyle; 847 return m_typingStyle;
848 } 848 }
849 849
850 } // namespace WebCore 850 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698