| 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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 // not set will result in a zoom reset on small devices. | 162 // not set will result in a zoom reset on small devices. |
| 163 if (ownerFrame().frame()->document()->textAutosizer()->pageNeedsAutosizing()
) { | 163 if (ownerFrame().frame()->document()->textAutosizer()->pageNeedsAutosizing()
) { |
| 164 ownerFrame().viewImpl()->zoomToFindInPageRect(ownerFrame().frameView()->
contentsToRootFrame(enclosingIntRect(LayoutObject::absoluteBoundingBoxRectForRan
ge(m_activeMatch.get())))); | 164 ownerFrame().viewImpl()->zoomToFindInPageRect(ownerFrame().frameView()->
contentsToRootFrame(enclosingIntRect(LayoutObject::absoluteBoundingBoxRectForRan
ge(m_activeMatch.get())))); |
| 165 } | 165 } |
| 166 | 166 |
| 167 setMarkerActive(m_activeMatch.get(), true); | 167 setMarkerActive(m_activeMatch.get(), true); |
| 168 WebLocalFrameImpl* oldActiveFrame = mainFrameImpl->ensureTextFinder().m_curr
entActiveMatchFrame; | 168 WebLocalFrameImpl* oldActiveFrame = mainFrameImpl->ensureTextFinder().m_curr
entActiveMatchFrame; |
| 169 mainFrameImpl->ensureTextFinder().m_currentActiveMatchFrame = &ownerFrame(); | 169 mainFrameImpl->ensureTextFinder().m_currentActiveMatchFrame = &ownerFrame(); |
| 170 | 170 |
| 171 // Make sure no node is focused. See http://crbug.com/38700. | 171 // Make sure no node is focused. See http://crbug.com/38700. |
| 172 ownerFrame().frame()->document()->setFocusedElement(nullptr); | 172 ownerFrame().frame()->document()->clearFocusedElement(); |
| 173 | 173 |
| 174 if (!options.findNext || activeSelection) { | 174 if (!options.findNext || activeSelection) { |
| 175 // This is either a Find operation or a Find-next from a new start point | 175 // This is either a Find operation or a Find-next from a new start point |
| 176 // due to a selection, so we set the flag to ask the scoping effort | 176 // due to a selection, so we set the flag to ask the scoping effort |
| 177 // to find the active rect for us and report it back to the UI. | 177 // to find the active rect for us and report it back to the UI. |
| 178 m_locatingActiveRect = true; | 178 m_locatingActiveRect = true; |
| 179 } else { | 179 } else { |
| 180 if (oldActiveFrame != &ownerFrame()) { | 180 if (oldActiveFrame != &ownerFrame()) { |
| 181 if (options.forward) | 181 if (options.forward) |
| 182 m_activeMatchIndexInCurrentFrame = 0; | 182 m_activeMatchIndexInCurrentFrame = 0; |
| (...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 623 mainFrameTextFinder.m_currentActiveMatchFrame = &ownerFrame(); | 623 mainFrameTextFinder.m_currentActiveMatchFrame = &ownerFrame(); |
| 624 ownerFrame().viewImpl()->setFocusedFrame(&ownerFrame()); | 624 ownerFrame().viewImpl()->setFocusedFrame(&ownerFrame()); |
| 625 | 625 |
| 626 m_activeMatch = range.release(); | 626 m_activeMatch = range.release(); |
| 627 setMarkerActive(m_activeMatch.get(), true); | 627 setMarkerActive(m_activeMatch.get(), true); |
| 628 | 628 |
| 629 // Clear any user selection, to make sure Find Next continues on from th
e match we just activated. | 629 // Clear any user selection, to make sure Find Next continues on from th
e match we just activated. |
| 630 ownerFrame().frame()->selection().clear(); | 630 ownerFrame().frame()->selection().clear(); |
| 631 | 631 |
| 632 // Make sure no node is focused. See http://crbug.com/38700. | 632 // Make sure no node is focused. See http://crbug.com/38700. |
| 633 ownerFrame().frame()->document()->setFocusedElement(nullptr); | 633 ownerFrame().frame()->document()->clearFocusedElement(); |
| 634 } | 634 } |
| 635 | 635 |
| 636 IntRect activeMatchRect; | 636 IntRect activeMatchRect; |
| 637 IntRect activeMatchBoundingBox = enclosingIntRect(LayoutObject::absoluteBoun
dingBoxRectForRange(m_activeMatch.get())); | 637 IntRect activeMatchBoundingBox = enclosingIntRect(LayoutObject::absoluteBoun
dingBoxRectForRange(m_activeMatch.get())); |
| 638 | 638 |
| 639 if (!activeMatchBoundingBox.isEmpty()) { | 639 if (!activeMatchBoundingBox.isEmpty()) { |
| 640 if (m_activeMatch->firstNode() && m_activeMatch->firstNode()->layoutObje
ct()) { | 640 if (m_activeMatch->firstNode() && m_activeMatch->firstNode()->layoutObje
ct()) { |
| 641 m_activeMatch->firstNode()->layoutObject()->scrollRectToVisible( | 641 m_activeMatch->firstNode()->layoutObject()->scrollRectToVisible( |
| 642 LayoutRect(activeMatchBoundingBox), ScrollAlignment::alignCenter
IfNeeded, ScrollAlignment::alignCenterIfNeeded, UserScroll); | 642 LayoutRect(activeMatchBoundingBox), ScrollAlignment::alignCenter
IfNeeded, ScrollAlignment::alignCenterIfNeeded, UserScroll); |
| 643 } | 643 } |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 816 visitor->trace(m_ownerFrame); | 816 visitor->trace(m_ownerFrame); |
| 817 visitor->trace(m_currentActiveMatchFrame); | 817 visitor->trace(m_currentActiveMatchFrame); |
| 818 visitor->trace(m_activeMatch); | 818 visitor->trace(m_activeMatch); |
| 819 visitor->trace(m_resumeScopingFromRange); | 819 visitor->trace(m_resumeScopingFromRange); |
| 820 visitor->trace(m_deferredScopingWork); | 820 visitor->trace(m_deferredScopingWork); |
| 821 visitor->trace(m_findMatchesCache); | 821 visitor->trace(m_findMatchesCache); |
| 822 #endif | 822 #endif |
| 823 } | 823 } |
| 824 | 824 |
| 825 } // namespace blink | 825 } // namespace blink |
| OLD | NEW |