Changeset 128351 in webkit


Ignore:
Timestamp:
Sep 12, 2012 1:02:25 PM (12 years ago)
Author:
leandrogracia@chromium.org
Message:

[Chromium] Fix cases where find-in-page doesn't send a final update
https://bugs.webkit.org/show_bug.cgi?id=96402

Fix some issues in the WebKit implementation that prevented to send a final
reportFindInPageMatchCount message. Also, fix a buggy reset of the active match
when calling the stopFinding method.

Reviewed by Adam Barth.

  • src/WebFrameImpl.cpp:

(WebKit::WebFrameImpl::scopeStringMatches):
(WebKit::WebFrameImpl::cancelPendingScopingEffort):
(WebKit::WebFrameImpl::setFindEndstateFocusAndSelection):
(WebKit::WebFrameImpl::shouldScopeMatches):

Location:
trunk/Source/WebKit/chromium
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/chromium/ChangeLog

    r128347 r128351  
     12012-09-12  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. Also, fix a buggy reset of the active match
     8        when calling the stopFinding method.
     9
     10        Reviewed by Adam Barth.
     11
     12        * src/WebFrameImpl.cpp:
     13        (WebKit::WebFrameImpl::scopeStringMatches):
     14        (WebKit::WebFrameImpl::cancelPendingScopingEffort):
     15        (WebKit::WebFrameImpl::setFindEndstateFocusAndSelection):
     16        (WebKit::WebFrameImpl::shouldScopeMatches):
     17
    1182012-09-12  Sami Kyostila  <skyostil@google.com>
    219
  • trunk/Source/WebKit/chromium/src/WebFrameImpl.cpp

    r128123 r128351  
    17801780                                      bool reset)
    17811781{
    1782     if (!shouldScopeMatches(searchText))
     1782    if (!shouldScopeMatches(searchText)) {
     1783        increaseMatchCount(0, identifier);
    17831784        return;
     1785    }
    17841786
    17851787    WebFrameImpl* mainFrameImpl = viewImpl()->mainFrameImpl();
     
    19571959    deleteAllValues(m_deferredScopingWork);
    19581960    m_deferredScopingWork.clear();
     1961
     1962    // Clear the active match, for two reasons:
     1963    // We just finished the find 'session' and we don't want future (potentially
     1964    // unrelated) find 'sessions' operations to start at the same place.
     1965    // The WebFrameImpl could get reused and the m_activeMatch could end up pointing
     1966    // to a document that is no longer valid. Keeping an invalid reference around
     1967    // is just asking for trouble.
     1968    m_activeMatch = 0;
    19591969
    19601970    m_activeMatchIndexInCurrentFrame = -1;
     
    25232533        frame()->selection()->setSelection(m_activeMatch.get());
    25242534        frame()->document()->setFocusedNode(0);
    2525 
    2526         // Finally clear the active match, for two reasons:
    2527         // We just finished the find 'session' and we don't want future (potentially
    2528         // unrelated) find 'sessions' operations to start at the same place.
    2529         // The WebFrameImpl could get reused and the m_activeMatch could end up pointing
    2530         // to a document that is no longer valid. Keeping an invalid reference around
    2531         // is just asking for trouble.
    2532         m_activeMatch = 0;
    25332535    }
    25342536}
     
    26132615bool WebFrameImpl::shouldScopeMatches(const String& searchText)
    26142616{
    2615     // Don't scope if we can't find a frame or a view or if the frame is not visible.
     2617    // Don't scope if we can't find a frame or a view.
    26162618    // The user may have closed the tab/application, so abort.
    2617     if (!frame() || !frame()->view() || !hasVisibleContent())
     2619    if (!frame() || !frame()->view())
    26182620        return false;
    26192621
Note: See TracChangeset for help on using the changeset viewer.