From 4578cb2d5ad57ed3ff6ebcbe9cfa7b241d558aad Mon Sep 17 00:00:00 2001 From: "radha%netscape.com" Date: Thu, 11 Oct 2001 18:50:05 +0000 Subject: [PATCH] Fox for bug 96230. Back button does not preserve scroll bar positions on local files and ftp directory listings. r=adamlock sr=darin. --- docshell/base/nsDocShell.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index f448869816ec..246776812098 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -5475,6 +5475,7 @@ nsDocShell::AddToSessionHistory(nsIURI * aURI, nsCOMPtr cacheKey; nsCOMPtr cacheToken; PRPackedBool expired = PR_FALSE; + nsXPIDLCString val; if (aChannel) { nsCOMPtr cacheChannel(do_QueryInterface(aChannel)); @@ -5490,6 +5491,7 @@ nsDocShell::AddToSessionHistory(nsIURI * aURI, if (httpChannel) { httpChannel->GetUploadStream(getter_AddRefs(inputStream)); httpChannel->GetReferrer(getter_AddRefs(referrerURI)); + httpChannel->GetResponseHeader("Cache-Control", getter_Copies(val)); } } @@ -5504,10 +5506,11 @@ nsDocShell::AddToSessionHistory(nsIURI * aURI, /* If cache got a 'no-store', ask SH not to store * HistoryLayoutState. By default, SH will set this * flag to PR_TRUE and save HistoryLayoutState. - */ - if (!cacheToken) + */ + if (PL_strcasestr(val, "no-store")) { entry->SetSaveLayoutStateFlag(PR_FALSE); - else { + } + if (cacheToken) { // Check if the page has expired from cache nsCOMPtr cacheEntryDesc(do_QueryInterface(cacheToken)); if (cacheEntryDesc) {