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

Side by Side Diff: Source/core/editing/VisibleUnits.cpp

Issue 1321133003: Make nextBoundary() to use lastPositionInNode() instead of RangeBoundaryPoint::setToEndOfNode() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-09-03T13:22:08 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 | « no previous file | 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) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed. 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed.
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 753 matching lines...) Expand 10 before | Expand all | Expand 10 after
764 int i = startOfLastWordBoundaryContext(characters.data(), length); 764 int i = startOfLastWordBoundaryContext(characters.data(), length);
765 string.prepend(characters.data() + i, length - i); 765 string.prepend(characters.data() + i, length - i);
766 prefixLength += length - i; 766 prefixLength += length - i;
767 if (i > 0) 767 if (i > 0)
768 break; 768 break;
769 backwardsIterator.advance(); 769 backwardsIterator.advance();
770 } 770 }
771 } 771 }
772 772
773 Position searchStart = Position::editingPositionOf(start.anchorNode(), start .offsetInContainerNode()); 773 Position searchStart = Position::editingPositionOf(start.anchorNode(), start .offsetInContainerNode());
774 RangeBoundaryPoint searchEndPoint(boundary); 774 Position searchEnd = Position::lastPositionInNode(boundary);
775 searchEndPoint.setToEndOfNode(*boundary);
776 Position searchEnd = searchEndPoint.toPosition();
777 TextIterator it(searchStart, searchEnd, TextIteratorEmitsCharactersBetweenAl lVisiblePositions); 775 TextIterator it(searchStart, searchEnd, TextIteratorEmitsCharactersBetweenAl lVisiblePositions);
778 const unsigned invalidOffset = static_cast<unsigned>(-1); 776 const unsigned invalidOffset = static_cast<unsigned>(-1);
779 unsigned next = invalidOffset; 777 unsigned next = invalidOffset;
780 bool needMoreContext = false; 778 bool needMoreContext = false;
781 while (!it.atEnd()) { 779 while (!it.atEnd()) {
782 // Keep asking the iterator for chunks until the search function 780 // Keep asking the iterator for chunks until the search function
783 // returns an end value not equal to the length of the string passed to it. 781 // returns an end value not equal to the length of the string passed to it.
784 bool inTextSecurityMode = it.node() && it.node()->layoutObject() && it.n ode()->layoutObject()->style()->textSecurity() != TSNONE; 782 bool inTextSecurityMode = it.node() && it.node()->layoutObject() && it.n ode()->layoutObject()->style()->textSecurity() != TSNONE;
785 if (!inTextSecurityMode) { 783 if (!inTextSecurityMode) {
786 it.text().appendTextTo(string); 784 it.text().appendTextTo(string);
(...skipping 2181 matching lines...) Expand 10 before | Expand all | Expand 10 after
2968 return honorEditingBoundaryAtOrBefore(prev, visiblePosition.deepEquivale nt()); 2966 return honorEditingBoundaryAtOrBefore(prev, visiblePosition.deepEquivale nt());
2969 case CanSkipOverEditingBoundary: 2967 case CanSkipOverEditingBoundary:
2970 return skipToStartOfEditingBoundary(prev, visiblePosition.deepEquivalent ()); 2968 return skipToStartOfEditingBoundary(prev, visiblePosition.deepEquivalent ());
2971 } 2969 }
2972 2970
2973 ASSERT_NOT_REACHED(); 2971 ASSERT_NOT_REACHED();
2974 return honorEditingBoundaryAtOrBefore(prev, visiblePosition.deepEquivalent() ); 2972 return honorEditingBoundaryAtOrBefore(prev, visiblePosition.deepEquivalent() );
2975 } 2973 }
2976 2974
2977 } // namespace blink 2975 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698