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

Side by Side Diff: third_party/WebKit/Source/core/editing/commands/DeleteSelectionCommand.cpp

Issue 2373483003: Ensure valid VisiblePosition input for absoluteCaretBoundsOf (Closed)
Patch Set: Created 4 years, 2 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 669 matching lines...) Expand 10 before | Expand all | Expand 10 after
680 && canMergeLists(listItemInFirstParagraph->parentElement(), listItemInSe condParagraph->parentElement())) { 680 && canMergeLists(listItemInFirstParagraph->parentElement(), listItemInSe condParagraph->parentElement())) {
681 mergeIdenticalElements(listItemInFirstParagraph->parentElement(), listIt emInSecondParagraph->parentElement(), editingState); 681 mergeIdenticalElements(listItemInFirstParagraph->parentElement(), listIt emInSecondParagraph->parentElement(), editingState);
682 if (editingState->isAborted()) 682 if (editingState->isAborted())
683 return; 683 return;
684 m_endingPosition = mergeDestination.deepEquivalent(); 684 m_endingPosition = mergeDestination.deepEquivalent();
685 return; 685 return;
686 } 686 }
687 687
688 // The rule for merging into an empty block is: only do so if its farther to the right. 688 // The rule for merging into an empty block is: only do so if its farther to the right.
689 // FIXME: Consider RTL. 689 // FIXME: Consider RTL.
690 if (!m_startsAtEmptyLine && isStartOfParagraphDeprecated(mergeDestination) & & absoluteCaretBoundsOf(startOfParagraphToMove).x() > absoluteCaretBoundsOf(merg eDestination).x()) { 690 if (!m_startsAtEmptyLine && isStartOfParagraphDeprecated(mergeDestination) & & absoluteCaretBoundsOfDeprecated(startOfParagraphToMove).x() > absoluteCaretBou ndsOfDeprecated(mergeDestination).x()) {
691 if (isHTMLBRElement(*mostForwardCaretPosition(mergeDestination.deepEquiv alent()).anchorNode())) { 691 if (isHTMLBRElement(*mostForwardCaretPosition(mergeDestination.deepEquiv alent()).anchorNode())) {
692 removeNodeAndPruneAncestors(mostForwardCaretPosition(mergeDestinatio n.deepEquivalent()).anchorNode(), editingState); 692 removeNodeAndPruneAncestors(mostForwardCaretPosition(mergeDestinatio n.deepEquivalent()).anchorNode(), editingState);
693 if (editingState->isAborted()) 693 if (editingState->isAborted())
694 return; 694 return;
695 m_endingPosition = startOfParagraphToMove.deepEquivalent(); 695 m_endingPosition = startOfParagraphToMove.deepEquivalent();
696 return; 696 return;
697 } 697 }
698 } 698 }
699 699
700 // Block images, tables and horizontal rules cannot be made inline with cont ent at mergeDestination. If there is 700 // Block images, tables and horizontal rules cannot be made inline with cont ent at mergeDestination. If there is
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
963 visitor->trace(m_deleteIntoBlockquoteStyle); 963 visitor->trace(m_deleteIntoBlockquoteStyle);
964 visitor->trace(m_startRoot); 964 visitor->trace(m_startRoot);
965 visitor->trace(m_endRoot); 965 visitor->trace(m_endRoot);
966 visitor->trace(m_startTableRow); 966 visitor->trace(m_startTableRow);
967 visitor->trace(m_endTableRow); 967 visitor->trace(m_endTableRow);
968 visitor->trace(m_temporaryPlaceholder); 968 visitor->trace(m_temporaryPlaceholder);
969 CompositeEditCommand::trace(visitor); 969 CompositeEditCommand::trace(visitor);
970 } 970 }
971 971
972 } // namespace blink 972 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698