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

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

Issue 1909343003: TextIteratorAlgorithm should not force layout update in constructor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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) 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 808 matching lines...) Expand 10 before | Expand all | Expand 10 after
819 // context, but there is no further text. Force a search with what's 819 // context, but there is no further text. Force a search with what's
820 // available. 820 // available.
821 // TODO(xiaochengh): Do we still have to search the whole string? 821 // TODO(xiaochengh): Do we still have to search the whole string?
822 next = searchFunction(string.data(), string.size(), prefixLength, DontHa veMoreContext, needMoreContext); 822 next = searchFunction(string.data(), string.size(), prefixLength, DontHa veMoreContext, needMoreContext);
823 DCHECK(!needMoreContext); 823 DCHECK(!needMoreContext);
824 } 824 }
825 825
826 if (it.atEnd() && next == string.size()) { 826 if (it.atEnd() && next == string.size()) {
827 pos = it.startPositionInCurrentContainer(); 827 pos = it.startPositionInCurrentContainer();
828 } else if (next != invalidOffset && next != prefixLength) { 828 } else if (next != invalidOffset && next != prefixLength) {
829 // TODO(dglazkov): The use of updateLayoutIgnorePendingStylesheets needs to be audited.
830 // see http://crbug.com/590369 for more details.
831 searchStart.document()->updateLayoutIgnorePendingStylesheets();
829 // Use the character iterator to translate the next value into a DOM 832 // Use the character iterator to translate the next value into a DOM
830 // position. 833 // position.
831 CharacterIteratorAlgorithm<Strategy> charIt(searchStart, searchEnd, Text IteratorEmitsCharactersBetweenAllVisiblePositions); 834 CharacterIteratorAlgorithm<Strategy> charIt(searchStart, searchEnd, Text IteratorEmitsCharactersBetweenAllVisiblePositions);
832 charIt.advance(next - prefixLength - 1); 835 charIt.advance(next - prefixLength - 1);
833 pos = charIt.endPosition(); 836 pos = charIt.endPosition();
834 837
835 if (charIt.characterAt(0) == '\n') { 838 if (charIt.characterAt(0) == '\n') {
836 // TODO(yosin) workaround for collapsed range (where only start 839 // TODO(yosin) workaround for collapsed range (where only start
837 // position is correct) emitted for some emitted newlines 840 // position is correct) emitted for some emitted newlines
838 // (see rdar://5192593) 841 // (see rdar://5192593)
(...skipping 2416 matching lines...) Expand 10 before | Expand all | Expand 10 after
3255 { 3258 {
3256 return previousPositionOfAlgorithm<EditingStrategy>(visiblePosition, rule); 3259 return previousPositionOfAlgorithm<EditingStrategy>(visiblePosition, rule);
3257 } 3260 }
3258 3261
3259 VisiblePositionInFlatTree previousPositionOf(const VisiblePositionInFlatTree& vi siblePosition, EditingBoundaryCrossingRule rule) 3262 VisiblePositionInFlatTree previousPositionOf(const VisiblePositionInFlatTree& vi siblePosition, EditingBoundaryCrossingRule rule)
3260 { 3263 {
3261 return previousPositionOfAlgorithm<EditingInFlatTreeStrategy>(visiblePositio n, rule); 3264 return previousPositionOfAlgorithm<EditingInFlatTreeStrategy>(visiblePositio n, rule);
3262 } 3265 }
3263 3266
3264 } // namespace blink 3267 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698