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

Side by Side Diff: Source/core/editing/iterators/CharacterIterator.cpp

Issue 1213213004: Introduce use counters for shadow DOM handling in plainText() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-07-03T14:40:27 Rebase Created 5 years, 5 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 | « Source/core/editing/FindOptions.h ('k') | Source/core/editing/iterators/TextIterator.h » ('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 610 matching lines...) Expand 10 before | Expand all | Expand 10 after
621 resultEnd.clear(); 621 resultEnd.clear();
622 // CharacterIterator requires layoutObjects to be up-to-date. 622 // CharacterIterator requires layoutObjects to be up-to-date.
623 if (!inputStart.inDocument()) 623 if (!inputStart.inDocument())
624 return; 624 return;
625 ASSERT(inputStart.document() == inputEnd.document()); 625 ASSERT(inputStart.document() == inputEnd.document());
626 626
627 // FIXME: Reduce the code duplication with above (but how?). 627 // FIXME: Reduce the code duplication with above (but how?).
628 size_t matchStart; 628 size_t matchStart;
629 size_t matchLength; 629 size_t matchLength;
630 { 630 {
631 CharacterIterator findIterator(inputStart, inputEnd, iteratorFlagsForFin dPlainText); 631 TextIteratorBehaviorFlags behavior = iteratorFlagsForFindPlainText;
632 if (options & FindAPICall)
633 behavior |= TextIteratorForWindowFind;
634 CharacterIterator findIterator(inputStart, inputEnd, behavior);
632 matchLength = findPlainTextInternal(findIterator, target, options, match Start); 635 matchLength = findPlainTextInternal(findIterator, target, options, match Start);
633 if (!matchLength) { 636 if (!matchLength) {
634 const Position& collapseTo = options & Backwards ? inputStart : inpu tEnd; 637 const Position& collapseTo = options & Backwards ? inputStart : inpu tEnd;
635 resultStart = collapseTo; 638 resultStart = collapseTo;
636 resultEnd = collapseTo; 639 resultEnd = collapseTo;
637 return; 640 return;
638 } 641 }
639 } 642 }
640 643
641 CharacterIterator computeRangeIterator(inputStart, inputEnd, iteratorFlagsFo rFindPlainText); 644 CharacterIterator computeRangeIterator(inputStart, inputEnd, iteratorFlagsFo rFindPlainText);
642 computeRangeIterator.calculateCharacterSubrange(matchStart, matchLength, res ultStart, resultEnd); 645 computeRangeIterator.calculateCharacterSubrange(matchStart, matchLength, res ultStart, resultEnd);
643 } 646 }
644 647
645 } // namespace blink 648 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/editing/FindOptions.h ('k') | Source/core/editing/iterators/TextIterator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698