Commit e6dd2557 authored by eric@webkit.org's avatar eric@webkit.org
Browse files

2009-12-01 Xiyuan Xia <xiyuan@chromium.org>

        Reviewed by Darin Fisher.

        Only fire start/stop events when main frame is not loading.

        https://bugs.webkit.org/show_bug.cgi?id=31838

        * src/FrameLoaderClientImpl.cpp:
        (WebKit::FrameLoaderClientImpl::dispatchDidChangeLocationWithinPage):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51548 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent c4d65298
2009-12-01 Xiyuan Xia <xiyuan@chromium.org>
Reviewed by Darin Fisher.
Only fire start/stop events when main frame is not loading.
https://bugs.webkit.org/show_bug.cgi?id=31838
* src/FrameLoaderClientImpl.cpp:
(WebKit::FrameLoaderClientImpl::dispatchDidChangeLocationWithinPage):
2009-11-27 Yury Semikhatsky <yurys@chromium.org>
Reviewed by Pavel Feldman.
......
......@@ -539,7 +539,16 @@ void FrameLoaderClientImpl::dispatchDidChangeLocationWithinPage()
// Anchor fragment navigations are not normal loads, so we need to synthesize
// some events for our delegate.
WebViewImpl* webView = m_webFrame->viewImpl();
if (webView->client())
// Flag of whether frame loader is completed. Generate didStartLoading and
// didStopLoading only when loader is completed so that we don't fire
// them for fragment redirection that happens in window.onload handler.
// See https://bugs.webkit.org/show_bug.cgi?id=31838
bool loaderCompleted =
!m_webFrame->frame()->page()->mainFrame()->loader()->isLoading();
// Generate didStartLoading if loader is completed.
if (webView->client() && loaderCompleted)
webView->client()->didStartLoading();
WebDataSourceImpl* ds = m_webFrame->dataSourceImpl();
......@@ -585,7 +594,8 @@ void FrameLoaderClientImpl::dispatchDidChangeLocationWithinPage()
if (m_webFrame->client())
m_webFrame->client()->didChangeLocationWithinPage(m_webFrame, isNewNavigation);
if (webView->client())
// Generate didStopLoading if loader is completed.
if (webView->client() && loaderCompleted)
webView->client()->didStopLoading();
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment