diff --git a/docshell/shistory/public/nsISHEntry.idl b/docshell/shistory/public/nsISHEntry.idl index ac23daf51b8..a3bc772715c 100644 --- a/docshell/shistory/public/nsISHEntry.idl +++ b/docshell/shistory/public/nsISHEntry.idl @@ -74,6 +74,9 @@ attribute unsigned long ID; /** attribute to set and get the cache key for the entry */ attribute nsISupports cacheKey; +/** attribute to indicate whether layoutHistoryState should be saved */ +attribute boolean saveHistoryStateFlag; + /** 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/docshell/shistory/src/nsSHEntry.cpp b/docshell/shistory/src/nsSHEntry.cpp index 309e067227a..a35257b54e4 100644 --- a/docshell/shistory/src/nsSHEntry.cpp +++ b/docshell/shistory/src/nsSHEntry.cpp @@ -223,6 +223,20 @@ NS_IMETHODIMP nsSHEntry::SetCacheKey(nsISupports* aCacheKey) return NS_OK; } +NS_IMETHODIMP nsSHEntry::GetSaveHistoryStateFlag(PRBool * aFlag) +{ + NS_ENSURE_ARG_POINTER(aFlag); + + *aFlag = mSaveHistoryState; + return NS_OK; +} + +NS_IMETHODIMP nsSHEntry::SetSaveHistoryStateFlag(PRBool aFlag) +{ + mSaveHistoryState = aFlag; + return NS_OK; +} + nsresult nsSHEntry::Create(nsIURI * aURI, const PRUnichar * aTitle, nsIDOMDocument * aDOMDocument, nsIInputStream * aInputStream, nsILayoutHistoryState * aHistoryLayoutState, @@ -243,6 +257,9 @@ nsSHEntry::Create(nsIURI * aURI, const PRUnichar * aTitle, nsIDOMDocument * aDOM // all subframe navigations, sets the flag to true. SetIsSubFrame(PR_FALSE); + // By default we save HistoryLayoutState + SetSaveHistoryStateFlag(PR_TRUE); + return NS_OK; } diff --git a/docshell/shistory/src/nsSHEntry.h b/docshell/shistory/src/nsSHEntry.h index 62ede83dd56..f42a8f1da3f 100644 --- a/docshell/shistory/src/nsSHEntry.h +++ b/docshell/shistory/src/nsSHEntry.h @@ -65,6 +65,7 @@ private: PRUint32 mLoadType; PRUint32 mID; PRBool mIsFrameNavigation; + PRBool mSaveHistoryState; nsCOMPtr mCacheKey; nsISHEntry * mParent; // weak reference };