diff --git a/mozilla/docshell/base/nsDocShell.cpp b/mozilla/docshell/base/nsDocShell.cpp index f35f87faea1..9a8d344b5df 100644 --- a/mozilla/docshell/base/nsDocShell.cpp +++ b/mozilla/docshell/base/nsDocShell.cpp @@ -413,7 +413,12 @@ nsDocShell::LoadURI(nsIURI* aURI, nsIDocShellLoadInfo* aLoadInfo, PRUint32 aLoad if (parent) { parent->GetChildSHEntry(mChildOffset, getter_AddRefs(shEntry)); if (shEntry) { - loadType = LOAD_HISTORY; + //Get the proper loadType from the SHEntry. + PRUint32 lt; + shEntry->GetLoadType(<); + // Convert the DocShellInfoLoadType returned by the + // previous function to loadType + loadType = ConvertDocShellLoadInfoToLoadType((nsDocShellInfoLoadType)lt); } } } @@ -1213,10 +1218,18 @@ nsDocShell::GetChildSHEntry(PRInt32 aChildOffset, nsISHEntry ** aResult) // the progress of loading a document too... // if (LSHE) { - nsCOMPtr container(do_QueryInterface(LSHE)); - if (container) { - rv = container->GetChildAt(aChildOffset, aResult); - } + /* Get the parent's Load Type so that it can be set on the child too. + * By default give a loadHistory value + */ + PRUint32 loadType = nsIDocShellLoadInfo::loadHistory; + LSHE->GetLoadType(&loadType); + nsCOMPtr container(do_QueryInterface(LSHE)); + if (container) { + rv = container->GetChildAt(aChildOffset, aResult); + if (*aResult) { + (*aResult)->SetLoadType(loadType); + } + } } return rv; } @@ -2539,6 +2552,8 @@ nsDocShell::OnStateChange(nsIWebProgress *aProgress, nsIRequest *aRequest, { if ((aStateFlags & STATE_STOP) && (aStateFlags & STATE_IS_NETWORK)) { + if (LSHE) + LSHE->SetLoadType(nsIDocShellLoadInfo::loadHistory); LSHE = nsnull; } return NS_OK; diff --git a/mozilla/xpfe/components/shistory/public/nsISHEntry.idl b/mozilla/xpfe/components/shistory/public/nsISHEntry.idl index 2f268dddc76..8b7222025ee 100644 --- a/mozilla/xpfe/components/shistory/public/nsISHEntry.idl +++ b/mozilla/xpfe/components/shistory/public/nsISHEntry.idl @@ -56,6 +56,12 @@ attribute nsILayoutHistoryState layoutHistoryState; /** parent of this entry */ attribute nsISHEntry parent; +/** + * The loadType for this entry. This is typically loadHistory except + * when reload is pressed, it has the appropriate reload flag + */ +attribute unsigned long loadType; + /** Additional ways to create an entry */ void create(in nsIURI aURI, in wstring aTitle, in nsIDOMDocument aDocument, in nsIInputStream aInputStream, in nsILayoutHistoryState aHistoryLayoutState); diff --git a/mozilla/xpfe/components/shistory/src/nsSHEntry.cpp b/mozilla/xpfe/components/shistory/src/nsSHEntry.cpp index 6d7e5b30398..4f4c066a549 100644 --- a/mozilla/xpfe/components/shistory/src/nsSHEntry.cpp +++ b/mozilla/xpfe/components/shistory/src/nsSHEntry.cpp @@ -23,6 +23,7 @@ // Local Includes #include "nsSHEntry.h" #include "nsXPIDLString.h" +#include "nsIDocShellLoadInfo.h" //***************************************************************************** //*** nsSHEntry: Object Management @@ -148,6 +149,19 @@ NS_IMETHODIMP nsSHEntry::SetLayoutHistoryState(nsILayoutHistoryState* aState) return NS_OK; } +NS_IMETHODIMP nsSHEntry::GetLoadType(PRUint32 * aResult) +{ + NS_ENSURE_ARG_POINTER(aResult); + + *aResult = mLoadType; + return NS_OK; +} + +NS_IMETHODIMP nsSHEntry::SetLoadType(PRUint32 aLoadType) +{ + mLoadType = aLoadType; + return NS_OK; +} nsresult nsSHEntry::Create(nsIURI * aURI, const PRUnichar * aTitle, nsIDOMDocument * aDOMDocument, @@ -158,6 +172,8 @@ nsSHEntry::Create(nsIURI * aURI, const PRUnichar * aTitle, nsIDOMDocument * aDOM SetDocument(aDOMDocument); SetPostData(aInputStream); SetLayoutHistoryState(aHistoryLayoutState); + // Set the LoadType by default to loadHistory during creation + SetLoadType((PRInt32)nsIDocShellLoadInfo::loadHistory); return NS_OK; } diff --git a/mozilla/xpfe/components/shistory/src/nsSHEntry.h b/mozilla/xpfe/components/shistory/src/nsSHEntry.h index 049c2295996..87d2ea2a88d 100644 --- a/mozilla/xpfe/components/shistory/src/nsSHEntry.h +++ b/mozilla/xpfe/components/shistory/src/nsSHEntry.h @@ -62,6 +62,7 @@ private: nsCOMPtr mPostData; nsCOMPtr mLayoutHistoryState; nsVoidArray mChildren; + PRUint32 mLoadType; nsISHEntry * mParent; // weak reference }; diff --git a/mozilla/xpfe/components/shistory/src/nsSHistory.cpp b/mozilla/xpfe/components/shistory/src/nsSHistory.cpp index 03bca9d007d..8ba11e192b7 100644 --- a/mozilla/xpfe/components/shistory/src/nsSHistory.cpp +++ b/mozilla/xpfe/components/shistory/src/nsSHistory.cpp @@ -496,6 +496,11 @@ nsSHistory::LoadEntry(PRInt32 aIndex, PRBool aReloadFlag, long aLoadType) return NS_ERROR_FAILURE; nextEntry->GetURI(getter_AddRefs(nexturi)); + /* Set the loadType in the SHEntry too to what was passed on. + * This will be passed on to child subframes later in nsDocShell, + * so that proper loadType is maintained through out a frameset + */ + nextEntry->SetLoadType(aLoadType); mRootDocShell->CreateLoadInfo (getter_AddRefs(loadInfo)); // This is not available yet