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

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

Issue 1300823002: Introduce PositionAlgorithm<Strategy>::editingPositionOf() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-18T17:38:11 Created 5 years, 4 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 542 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 } else if (!(startNodeWasDescendantOfEndNode && !m_upstreamStart .inDocument())) { 553 } else if (!(startNodeWasDescendantOfEndNode && !m_upstreamStart .inDocument())) {
554 int offset = 0; 554 int offset = 0;
555 if (m_upstreamStart.anchorNode()->isDescendantOf(m_downstrea mEnd.anchorNode())) { 555 if (m_upstreamStart.anchorNode()->isDescendantOf(m_downstrea mEnd.anchorNode())) {
556 Node* n = m_upstreamStart.anchorNode(); 556 Node* n = m_upstreamStart.anchorNode();
557 while (n && n->parentNode() != m_downstreamEnd.anchorNod e()) 557 while (n && n->parentNode() != m_downstreamEnd.anchorNod e())
558 n = n->parentNode(); 558 n = n->parentNode();
559 if (n) 559 if (n)
560 offset = n->nodeIndex() + 1; 560 offset = n->nodeIndex() + 1;
561 } 561 }
562 removeChildrenInRange(m_downstreamEnd.anchorNode(), offset, m_downstreamEnd.computeEditingOffset()); 562 removeChildrenInRange(m_downstreamEnd.anchorNode(), offset, m_downstreamEnd.computeEditingOffset());
563 m_downstreamEnd = createLegacyEditingPosition(m_downstreamEn d.anchorNode(), offset); 563 m_downstreamEnd = Position::editingPositionOf(m_downstreamEn d.anchorNode(), offset);
564 } 564 }
565 } 565 }
566 } 566 }
567 } 567 }
568 } 568 }
569 569
570 void DeleteSelectionCommand::fixupWhitespace() 570 void DeleteSelectionCommand::fixupWhitespace()
571 { 571 {
572 document().updateLayoutIgnorePendingStylesheets(); 572 document().updateLayoutIgnorePendingStylesheets();
573 // FIXME: isRenderedCharacter should be removed, and we should use VisiblePo sition::characterAfter and VisiblePosition::characterBefore 573 // FIXME: isRenderedCharacter should be removed, and we should use VisiblePo sition::characterAfter and VisiblePosition::characterBefore
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
897 visitor->trace(m_deleteIntoBlockquoteStyle); 897 visitor->trace(m_deleteIntoBlockquoteStyle);
898 visitor->trace(m_startRoot); 898 visitor->trace(m_startRoot);
899 visitor->trace(m_endRoot); 899 visitor->trace(m_endRoot);
900 visitor->trace(m_startTableRow); 900 visitor->trace(m_startTableRow);
901 visitor->trace(m_endTableRow); 901 visitor->trace(m_endTableRow);
902 visitor->trace(m_temporaryPlaceholder); 902 visitor->trace(m_temporaryPlaceholder);
903 CompositeEditCommand::trace(visitor); 903 CompositeEditCommand::trace(visitor);
904 } 904 }
905 905
906 } // namespace blink 906 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/editing/VisibleUnits.cpp ('k') | Source/core/editing/iterators/BackwardsCharacterIterator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698