OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |