Disable caching of documents when doing a subframe navigation, to help with site compatibility problems. Bug 304860, r=bzbarsky.

This commit is contained in:
bryner%brianryner.com 2005-08-19 20:58:17 +00:00
parent d1b7ed75b5
commit e5c9b5c90e

View File

@ -4846,6 +4846,19 @@ nsDocShell::CanSavePresentation(PRUint32 aLoadType, nsIRequest *aNewRequest)
if (maxViewers == 0)
return PR_FALSE;
// Don't cache the content viewer if we're in a subframe and the subframe
// pref is disabled.
PRBool cacheFrames = PR_FALSE;
mPrefs->GetBoolPref("browser.sessionhistory.cache_subframes",
&cacheFrames);
if (!cacheFrames) {
nsCOMPtr<nsIDocShellTreeItem> root;
GetSameTypeParent(getter_AddRefs(root));
if (root && root != this) {
return PR_FALSE; // this is a subframe load
}
}
// If the document does not want its presentation cached, then don't.
nsCOMPtr<nsIDocument> doc = do_QueryInterface(pWin->GetExtantDocument());
if (!doc || !doc->CanSavePresentation(aNewRequest))