From 1e4d6f871312fb0780ece54206e1a98db7a28972 Mon Sep 17 00:00:00 2001 From: "radha%netscape.com" Date: Thu, 6 Jul 2000 04:34:52 +0000 Subject: [PATCH] More changes regarding feature bug 36547 r=rpotts git-svn-id: svn://10.0.0.236/trunk@73746 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/docshell/base/nsDocShell.cpp | 37 ++++++++-------------------- 1 file changed, 10 insertions(+), 27 deletions(-) diff --git a/mozilla/docshell/base/nsDocShell.cpp b/mozilla/docshell/base/nsDocShell.cpp index a2f0f62f06e..038f80c96cf 100644 --- a/mozilla/docshell/base/nsDocShell.cpp +++ b/mozilla/docshell/base/nsDocShell.cpp @@ -3126,30 +3126,7 @@ nsDocShell::OnNewURI(nsIURI *aURI, nsIChannel *aChannel, nsDocShellInfoLoadType #ifdef SH_IN_FRAMES - if (!LSHE && updateHistory && (mItemType == typeContent)) { // Page load not from SH - /* If no LSHE by this time, then this page load was not initiated - * from SH. Now check, if you - * can get your SHEntry from your parent's LSHE. This will help - * determine if we are in the middle of restoring a sub-frame - * after the page load was originally initiated by SH. ie., you clicked - * on back/forward and went to a frameset page. and currently, - * a subframe in that page is being loaded. - */ - /* - nsCOMPtr parentAsItem; - GetSameTypeParent(getter_AddRefs(parentAsItem)); - - nsCOMPtr parent; - // Get your SHEntry from your parent - if (parentAsItem) { - parent = do_QueryInterface(parentAsItem); - if (!parent) - return NS_ERROR_FAILURE; - parent->GetSHEForChild(mChildOffset, getter_AddRefs(entry)); - } - - if (!entry) { // Parent didn't have any SHEntry for you - */ + if (!LSHE && updateHistory && (mItemType == typeContent)) { /* This is a fresh page getting loaded for the first time *. Create a Entry for it and add it to SH, if this is the * rootDocShell @@ -3200,9 +3177,6 @@ nsDocShell::OnNewURI(nsIURI *aURI, nsIChannel *aChannel, nsDocShellInfoLoadType if (NS_SUCCEEDED(rv)) { LSHE = entry; } - //} //!she - // Set the LSHE for non-SH initiated loads. - //LSHE = entry; } //!LSHE @@ -3228,6 +3202,15 @@ nsDocShell::OnNewURI(nsIURI *aURI, nsIChannel *aChannel, nsDocShellInfoLoadType } #endif /* SH_IN_FRAMES */ + if(updateHistory) + { + PRBool shouldAdd = PR_FALSE; + ShouldAddToGlobalHistory(aURI, &shouldAdd); + if(shouldAdd) + { + AddToGlobalHistory(aURI); + } + } SetCurrentURI(aURI); nsCOMPtr httpChannel(do_QueryInterface(aChannel));