зеркало из https://github.com/mozilla/pjs.git
Fix for bug # 55145. r=pollmann a=rpotts
This commit is contained in:
Родитель
2a10bf939f
Коммит
110bb785c4
|
@ -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<nsISHContainer> 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<nsISHContainer> 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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
||||
}
|
||||
|
|
|
@ -62,6 +62,7 @@ private:
|
|||
nsCOMPtr<nsIInputStream> mPostData;
|
||||
nsCOMPtr<nsILayoutHistoryState> mLayoutHistoryState;
|
||||
nsVoidArray mChildren;
|
||||
PRUint32 mLoadType;
|
||||
nsISHEntry * mParent; // weak reference
|
||||
};
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче