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

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

Issue 1483013003: Find In Page doesn't work properly when " " is searched (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebasing the patch Created 4 years, 11 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 | third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp » ('j') | 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, 2012 Apple Inc. All r ights reserved. 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r ights 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 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 } 407 }
408 if (it.atBreak() && !buffer.atBreak()) { 408 if (it.atBreak() && !buffer.atBreak()) {
409 buffer.reachedBreak(); 409 buffer.reachedBreak();
410 goto tryAgain; 410 goto tryAgain;
411 } 411 }
412 } 412 }
413 413
414 return matchLength; 414 return matchLength;
415 } 415 }
416 416
417 static const TextIteratorBehaviorFlags iteratorFlagsForFindPlainText = TextItera torEntersTextControls | TextIteratorEntersOpenShadowRoots | TextIteratorDoesNotB reakAtReplacedElement; 417 static const TextIteratorBehaviorFlags iteratorFlagsForFindPlainText = TextItera torEntersTextControls | TextIteratorEntersOpenShadowRoots | TextIteratorDoesNotB reakAtReplacedElement | TextIteratorCollapseTrailingSpace;
418 418
419 template <typename Strategy> 419 template <typename Strategy>
420 static EphemeralRangeTemplate<Strategy> findPlainTextAlgorithm(const EphemeralRa ngeTemplate<Strategy>& inputRange, const String& target, FindOptions options) 420 static EphemeralRangeTemplate<Strategy> findPlainTextAlgorithm(const EphemeralRa ngeTemplate<Strategy>& inputRange, const String& target, FindOptions options)
421 { 421 {
422 // CharacterIterator requires layoutObjects to be up-to-date. 422 // CharacterIterator requires layoutObjects to be up-to-date.
423 if (!inputRange.startPosition().inDocument()) 423 if (!inputRange.startPosition().inDocument())
424 return EphemeralRangeTemplate<Strategy>(); 424 return EphemeralRangeTemplate<Strategy>();
425 ASSERT(inputRange.startPosition().document() == inputRange.endPosition().doc ument()); 425 ASSERT(inputRange.startPosition().document() == inputRange.endPosition().doc ument());
426 426
427 // FIXME: Reduce the code duplication with above (but how?). 427 // FIXME: Reduce the code duplication with above (but how?).
(...skipping 17 matching lines...) Expand all
445 { 445 {
446 return findPlainTextAlgorithm<EditingStrategy>(inputRange, target, options); 446 return findPlainTextAlgorithm<EditingStrategy>(inputRange, target, options);
447 } 447 }
448 448
449 EphemeralRangeInComposedTree findPlainText(const EphemeralRangeInComposedTree& i nputRange, const String& target, FindOptions options) 449 EphemeralRangeInComposedTree findPlainText(const EphemeralRangeInComposedTree& i nputRange, const String& target, FindOptions options)
450 { 450 {
451 return findPlainTextAlgorithm<EditingInComposedTreeStrategy>(inputRange, tar get, options); 451 return findPlainTextAlgorithm<EditingInComposedTreeStrategy>(inputRange, tar get, options);
452 } 452 }
453 453
454 } // namespace blink 454 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698