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

Side by Side Diff: third_party/WebKit/Source/web/TextFinder.cpp

Issue 2724333002: Get rid of VisibleSelection::firstRangeOf() (Closed)
Patch Set: 2017-03-03T13:18:27 DCHECK(!range) => DCHECK(range) Created 3 years, 9 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 | « third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp ('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) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 124
125 // If the user has selected something since the last Find operation we want 125 // If the user has selected something since the last Find operation we want
126 // to start from there. Otherwise, we start searching from where the last Find 126 // to start from there. Otherwise, we start searching from where the last Find
127 // operation left off (either a Find or a FindNext operation). 127 // operation left off (either a Find or a FindNext operation).
128 VisibleSelection selection(ownerFrame() 128 VisibleSelection selection(ownerFrame()
129 .frame() 129 .frame()
130 ->selection() 130 ->selection()
131 .computeVisibleSelectionInDOMTreeDeprecated()); 131 .computeVisibleSelectionInDOMTreeDeprecated());
132 bool activeSelection = !selection.isNone(); 132 bool activeSelection = !selection.isNone();
133 if (activeSelection) { 133 if (activeSelection) {
134 m_activeMatch = firstRangeOf(selection); 134 m_activeMatch = createRange(firstEphemeralRangeOf(selection));
135 ownerFrame().frame()->selection().clear(); 135 ownerFrame().frame()->selection().clear();
136 } 136 }
137 137
138 DCHECK(ownerFrame().frame()); 138 DCHECK(ownerFrame().frame());
139 DCHECK(ownerFrame().frame()->view()); 139 DCHECK(ownerFrame().frame()->view());
140 const FindOptions findOptions = 140 const FindOptions findOptions =
141 (options.forward ? 0 : Backwards) | 141 (options.forward ? 0 : Backwards) |
142 (options.matchCase ? 0 : CaseInsensitive) | 142 (options.matchCase ? 0 : CaseInsensitive) |
143 (wrapWithinFrame ? WrapAround : 0) | 143 (wrapWithinFrame ? WrapAround : 0) |
144 (options.wordStart ? AtWordStarts : 0) | 144 (options.wordStart ? AtWordStarts : 0) |
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after
779 779
780 DEFINE_TRACE(TextFinder) { 780 DEFINE_TRACE(TextFinder) {
781 visitor->trace(m_ownerFrame); 781 visitor->trace(m_ownerFrame);
782 visitor->trace(m_activeMatch); 782 visitor->trace(m_activeMatch);
783 visitor->trace(m_resumeScopingFromRange); 783 visitor->trace(m_resumeScopingFromRange);
784 visitor->trace(m_deferredScopingWork); 784 visitor->trace(m_deferredScopingWork);
785 visitor->trace(m_findMatchesCache); 785 visitor->trace(m_findMatchesCache);
786 } 786 }
787 787
788 } // namespace blink 788 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698