OLD | NEW |
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 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
614 } | 614 } |
615 if (it.atBreak() && !buffer.atBreak()) { | 615 if (it.atBreak() && !buffer.atBreak()) { |
616 buffer.reachedBreak(); | 616 buffer.reachedBreak(); |
617 goto tryAgain; | 617 goto tryAgain; |
618 } | 618 } |
619 } | 619 } |
620 | 620 |
621 return matchLength; | 621 return matchLength; |
622 } | 622 } |
623 | 623 |
624 static const TextIteratorBehaviorFlags iteratorFlagsForFindPlainText = TextItera
torEntersTextControls | TextIteratorEntersAuthorShadowRoots | TextIteratorDoesNo
tBreakAtReplacedElement; | 624 static const TextIteratorBehaviorFlags iteratorFlagsForFindPlainText = TextItera
torEntersTextControls | TextIteratorEntersOpenShadowRoots | TextIteratorDoesNotB
reakAtReplacedElement; |
625 | 625 |
626 PassRefPtrWillBeRawPtr<Range> findPlainText(const Range* range, const String& ta
rget, FindOptions options) | 626 PassRefPtrWillBeRawPtr<Range> findPlainText(const Range* range, const String& ta
rget, FindOptions options) |
627 { | 627 { |
628 // First, find the text. | 628 // First, find the text. |
629 size_t matchStart; | 629 size_t matchStart; |
630 size_t matchLength; | 630 size_t matchLength; |
631 { | 631 { |
632 CharacterIterator findIterator(range, iteratorFlagsForFindPlainText); | 632 CharacterIterator findIterator(range, iteratorFlagsForFindPlainText); |
633 matchLength = findPlainTextInternal(findIterator, target, options, match
Start); | 633 matchLength = findPlainTextInternal(findIterator, target, options, match
Start); |
634 if (!matchLength) | 634 if (!matchLength) |
(...skipping 29 matching lines...) Expand all Loading... |
664 resultEnd = collapseTo; | 664 resultEnd = collapseTo; |
665 return; | 665 return; |
666 } | 666 } |
667 } | 667 } |
668 | 668 |
669 CharacterIterator computeRangeIterator(inputStart, inputEnd, iteratorFlagsFo
rFindPlainText); | 669 CharacterIterator computeRangeIterator(inputStart, inputEnd, iteratorFlagsFo
rFindPlainText); |
670 computeRangeIterator.calculateCharacterSubrange(matchStart, matchLength, res
ultStart, resultEnd); | 670 computeRangeIterator.calculateCharacterSubrange(matchStart, matchLength, res
ultStart, resultEnd); |
671 } | 671 } |
672 | 672 |
673 } // namespace blink | 673 } // namespace blink |
OLD | NEW |