<rdar://problem/5681557> On Windows Safari, mouse events are ignored after clicking on link that triggers download
Moved the call to cache page from provisionalLoadStarted() to commitProvisionalLoad(), since
provisionalLoadStarted() can be called for cases that do not result in a page navigation, for example,
when a link to download a file has been clicked.
Reviewed by John and Anders.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::provisionalLoadStarted):
(WebCore::FrameLoader::commitProvisionalLoad):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@29421 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/loader/FrameLoader.cpp b/WebCore/loader/FrameLoader.cpp
index 6696d3b..0eb71d6 100644
--- a/WebCore/loader/FrameLoader.cpp
+++ b/WebCore/loader/FrameLoader.cpp
@@ -1695,9 +1695,6 @@
m_firstLayoutDone = false;
cancelRedirection(true);
m_client->provisionalLoadStarted();
-
- if (canCachePage() && m_client->canCachePage() && !m_currentHistoryItem->isInPageCache())
- cachePageForHistoryItem(m_currentHistoryItem.get());
}
bool FrameLoader::userGestureHint()
@@ -2517,6 +2514,11 @@
RefPtr<CachedPage> cachedPage = prpCachedPage;
RefPtr<DocumentLoader> pdl = m_provisionalDocumentLoader;
+ // Check to see if we need to cache the page we are navigating away from into the back/forward cache.
+ // We are doing this here because we know for sure that a new page is about to be loaded.
+ if (canCachePage() && m_client->canCachePage() && !m_currentHistoryItem->isInPageCache())
+ cachePageForHistoryItem(m_currentHistoryItem.get());
+
if (m_loadType != FrameLoadTypeReplace)
closeOldDataSources();