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

Side by Side Diff: Source/WebCore/editing/TextIterator.cpp

Issue 7550057: Merge 91908 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/782/
Patch Set: Created 9 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
« no previous file with comments | « LayoutTests/editing/text-iterator/find-after-mutation-expected.txt ('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) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2005 Alexey Proskuryakov. 3 * Copyright (C) 2005 Alexey Proskuryakov.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 2551 matching lines...) Expand 10 before | Expand all | Expand 10 after
2562 buffer.reachedBreak(); 2562 buffer.reachedBreak();
2563 goto tryAgain; 2563 goto tryAgain;
2564 } 2564 }
2565 } 2565 }
2566 2566
2567 return matchLength; 2567 return matchLength;
2568 } 2568 }
2569 2569
2570 PassRefPtr<Range> findPlainText(const Range* range, const String& target, FindOp tions options) 2570 PassRefPtr<Range> findPlainText(const Range* range, const String& target, FindOp tions options)
2571 { 2571 {
2572 // CharacterIterator requires renderers to be up-to-date
2573 range->ownerDocument()->updateLayout();
2574
2572 // First, find the text. 2575 // First, find the text.
2573 size_t matchStart; 2576 size_t matchStart;
2574 size_t matchLength; 2577 size_t matchLength;
2575 { 2578 {
2576 CharacterIterator findIterator(range, TextIteratorEntersTextControls); 2579 CharacterIterator findIterator(range, TextIteratorEntersTextControls);
2577 matchLength = findPlainText(findIterator, target, options, matchStart); 2580 matchLength = findPlainText(findIterator, target, options, matchStart);
2578 if (!matchLength) 2581 if (!matchLength)
2579 return collapsedToBoundary(range, !(options & Backwards)); 2582 return collapsedToBoundary(range, !(options & Backwards));
2580 } 2583 }
2581 2584
2582 // Then, find the document position of the start and the end of the text. 2585 // Then, find the document position of the start and the end of the text.
2583 CharacterIterator computeRangeIterator(range, TextIteratorEntersTextControls ); 2586 CharacterIterator computeRangeIterator(range, TextIteratorEntersTextControls );
2584 return characterSubrange(computeRangeIterator, matchStart, matchLength); 2587 return characterSubrange(computeRangeIterator, matchStart, matchLength);
2585 } 2588 }
2586 2589
2587 } 2590 }
OLDNEW
« no previous file with comments | « LayoutTests/editing/text-iterator/find-after-mutation-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698