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

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

Issue 1308323004: Introduce absoluteCaretBoundsOf() for VisiblePosition (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-28T19:12:35 Rebase Created 5 years, 3 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
« no previous file with comments | « Source/core/editing/VisiblePosition.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 635 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 if (listItemInFirstParagraph && listItemInSecondParagraph 646 if (listItemInFirstParagraph && listItemInSecondParagraph
647 && listItemInFirstParagraph->parentElement() != listItemInSecondParagrap h->parentElement() 647 && listItemInFirstParagraph->parentElement() != listItemInSecondParagrap h->parentElement()
648 && canMergeLists(listItemInFirstParagraph->parentElement(), listItemInSe condParagraph->parentElement())) { 648 && canMergeLists(listItemInFirstParagraph->parentElement(), listItemInSe condParagraph->parentElement())) {
649 mergeIdenticalElements(listItemInFirstParagraph->parentElement(), listIt emInSecondParagraph->parentElement()); 649 mergeIdenticalElements(listItemInFirstParagraph->parentElement(), listIt emInSecondParagraph->parentElement());
650 m_endingPosition = mergeDestination.deepEquivalent(); 650 m_endingPosition = mergeDestination.deepEquivalent();
651 return; 651 return;
652 } 652 }
653 653
654 // The rule for merging into an empty block is: only do so if its farther to the right. 654 // The rule for merging into an empty block is: only do so if its farther to the right.
655 // FIXME: Consider RTL. 655 // FIXME: Consider RTL.
656 if (!m_startsAtEmptyLine && isStartOfParagraph(mergeDestination) && startOfP aragraphToMove.absoluteCaretBounds().x() > mergeDestination.absoluteCaretBounds( ).x()) { 656 if (!m_startsAtEmptyLine && isStartOfParagraph(mergeDestination) && absolute CaretBoundsOf(startOfParagraphToMove).x() > absoluteCaretBoundsOf(mergeDestinati on).x()) {
657 if (isHTMLBRElement(*mostForwardCaretPosition(mergeDestination.deepEquiv alent()).anchorNode())) { 657 if (isHTMLBRElement(*mostForwardCaretPosition(mergeDestination.deepEquiv alent()).anchorNode())) {
658 removeNodeAndPruneAncestors(mostForwardCaretPosition(mergeDestinatio n.deepEquivalent()).anchorNode()); 658 removeNodeAndPruneAncestors(mostForwardCaretPosition(mergeDestinatio n.deepEquivalent()).anchorNode());
659 m_endingPosition = startOfParagraphToMove.deepEquivalent(); 659 m_endingPosition = startOfParagraphToMove.deepEquivalent();
660 return; 660 return;
661 } 661 }
662 } 662 }
663 663
664 // Block images, tables and horizontal rules cannot be made inline with cont ent at mergeDestination. If there is 664 // Block images, tables and horizontal rules cannot be made inline with cont ent at mergeDestination. If there is
665 // any (!isStartOfParagraph(mergeDestination)), don't merge, just move the c aret to just before the selection we deleted. 665 // any (!isStartOfParagraph(mergeDestination)), don't merge, just move the c aret to just before the selection we deleted.
666 // See https://bugs.webkit.org/show_bug.cgi?id=25439 666 // See https://bugs.webkit.org/show_bug.cgi?id=25439
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
900 visitor->trace(m_deleteIntoBlockquoteStyle); 900 visitor->trace(m_deleteIntoBlockquoteStyle);
901 visitor->trace(m_startRoot); 901 visitor->trace(m_startRoot);
902 visitor->trace(m_endRoot); 902 visitor->trace(m_endRoot);
903 visitor->trace(m_startTableRow); 903 visitor->trace(m_startTableRow);
904 visitor->trace(m_endTableRow); 904 visitor->trace(m_endTableRow);
905 visitor->trace(m_temporaryPlaceholder); 905 visitor->trace(m_temporaryPlaceholder);
906 CompositeEditCommand::trace(visitor); 906 CompositeEditCommand::trace(visitor);
907 } 907 }
908 908
909 } // namespace blink 909 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/editing/VisiblePosition.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698