Changeset 128784 in webkit
- Timestamp:
- Sep 17, 2012 11:36:07 AM (12 years ago)
- Location:
- trunk/Source/WebKit/chromium
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/chromium/ChangeLog
r128773 r128784 1 2012-09-17 Leandro Gracia Gil <leandrogracia@chromium.org> 2 3 [Chromium] Fix cases where find-in-page doesn't send a final update 4 https://bugs.webkit.org/show_bug.cgi?id=96402 5 6 Fix some issues in the WebKit implementation that prevented to send a final 7 reportFindInPageMatchCount message. 8 9 Reviewed by Adam Barth. 10 11 * src/WebFrameImpl.cpp: 12 (WebKit::WebFrameImpl::scopeStringMatches): 13 (WebKit): 14 (WebKit::WebFrameImpl::finishCurrentScopingEffort): 15 (WebKit::WebFrameImpl::cancelPendingScopingEffort): 16 (WebKit::WebFrameImpl::WebFrameImpl): 17 (WebKit::WebFrameImpl::shouldScopeMatches): 18 * src/WebFrameImpl.h: 19 1 20 2012-09-17 Joshua Bell <jsbell@chromium.org> 2 21 -
trunk/Source/WebKit/chromium/src/WebFrameImpl.cpp
r128426 r128784 1780 1780 bool reset) 1781 1781 { 1782 if (!shouldScopeMatches(searchText))1783 return;1784 1785 1782 WebFrameImpl* mainFrameImpl = viewImpl()->mainFrameImpl(); 1786 1783 … … 1789 1786 // Scoping is just about to begin. 1790 1787 m_scopingComplete = false; 1788 1791 1789 // Clear highlighting for this frame. 1792 if (frame() ->editor()->markedTextMatchesAreHighlighted())1790 if (frame() && frame()->editor()->markedTextMatchesAreHighlighted()) 1793 1791 frame()->page()->unmarkAllTextMatches(); 1794 1792 … … 1810 1808 options, 1811 1809 false); // false=we just reset, so don't do it again. 1810 return; 1811 } 1812 1813 if (!shouldScopeMatches(searchText)) { 1814 // Note that we want to defer the final update when resetting even if shouldScopeMatches returns false. 1815 // This is done in order to prevent sending a final message based only on the results of the first frame 1816 // since m_framesScopingCount would be 0 as other frames have yet to reset. 1817 finishCurrentScopingEffort(identifier); 1812 1818 return; 1813 1819 } … … 1939 1945 } 1940 1946 1947 finishCurrentScopingEffort(identifier); 1948 } 1949 1950 void WebFrameImpl::finishCurrentScopingEffort(int identifier) 1951 { 1952 WebFrameImpl* mainFrameImpl = viewImpl()->mainFrameImpl(); 1953 1941 1954 // This frame has no further scoping left, so it is done. Other frames might, 1942 1955 // of course, continue to scope matches. 1943 1956 m_scopingComplete = true; 1944 1957 mainFrameImpl->m_framesScopingCount--; 1958 m_lastFindRequestCompletedWithNoMatches = !m_lastMatchCount; 1945 1959 1946 1960 // If this is the last frame to finish scoping we need to trigger the final … … 1959 1973 1960 1974 m_activeMatchIndexInCurrentFrame = -1; 1975 1976 if (!m_scopingComplete) 1977 m_lastFindRequestCompletedWithNoMatches = false; 1961 1978 } 1962 1979 … … 2331 2348 , m_framesScopingCount(-1) 2332 2349 , m_scopingComplete(false) 2350 , m_lastFindRequestCompletedWithNoMatches(false) 2333 2351 , m_nextInvalidateAfter(0) 2334 2352 , m_findMatchMarkersVersion(0) … … 2613 2631 bool WebFrameImpl::shouldScopeMatches(const String& searchText) 2614 2632 { 2615 // Don't scope if we can't find a frame or a view or if the frame is not visible.2633 // Don't scope if we can't find a frame or a view. 2616 2634 // The user may have closed the tab/application, so abort. 2617 if (!frame() || !frame()->view() || !hasVisibleContent())2635 if (!frame() || !frame()->view()) 2618 2636 return false; 2619 2637 … … 2623 2641 // time it was searched, then we don't have to search it again if the user is 2624 2642 // just adding to the search string or sending the same search string again. 2625 if (m_ scopingComplete && !m_lastSearchString.isEmpty() && !m_lastMatchCount) {2643 if (m_lastFindRequestCompletedWithNoMatches && !m_lastSearchString.isEmpty()) { 2626 2644 // Check to see if the search string prefixes match. 2627 2645 String previousSearchPrefix = -
trunk/Source/WebKit/chromium/src/WebFrameImpl.h
r127776 r128784 386 386 bool shouldScopeMatches(const WTF::String& searchText); 387 387 388 // Finishes the current scoping effort and triggers any updates if appropriate. 389 void finishCurrentScopingEffort(int identifier); 390 388 391 // Queue up a deferred call to scopeStringMatches. 389 392 void scopeStringMatchesSoon( … … 457 460 bool m_scopingComplete; 458 461 462 // Keeps track of whether the last find request completed its scoping effort 463 // without finding any matches in this frame. 464 bool m_lastFindRequestCompletedWithNoMatches; 465 459 466 // Keeps track of when the scoping effort should next invalidate the scrollbar 460 467 // and the frame area.
Note: See TracChangeset
for help on using the changeset viewer.