diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index cad9a43f58d6..f8005b94ea66 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -2339,14 +2339,13 @@ NS_IMETHODIMP nsDocShell::Embed(nsIContentViewer* aContentViewer, // XXX What if SetupNewViewer fails? OSHE = LSHE; -/* + PRBool updateHistory = PR_TRUE; // Determine if this type of load should update history switch(mLoadType) { - case nsIDocShellLoadInfo::loadHistory: - case nsIDocShellLoadInfo::loadReloadNormal: + case nsIDocShellLoadInfo::loadNormalReplace: case nsIDocShellLoadInfo::loadReloadBypassCache: case nsIDocShellLoadInfo::loadReloadBypassProxy: case nsIDocShellLoadInfo::loadReloadBypassProxyAndCache: @@ -2355,12 +2354,12 @@ NS_IMETHODIMP nsDocShell::Embed(nsIContentViewer* aContentViewer, default: break; } -*/ - if (OSHE) { + + if (OSHE && updateHistory) { nsCOMPtr layoutState; rv = OSHE->GetLayoutHistoryState(getter_AddRefs(layoutState)); - if (layoutState && (mLoadType != nsIDocShellLoadInfo::loadNormalReplace)) { + if (layoutState) { // This is a SH load. That's why there is a LayoutHistoryState in OSHE nsCOMPtr presShell; rv = GetPresShell(getter_AddRefs(presShell));