Fix for bug 59774. Save scrollbar positions in sessionhistory when jumping from one anchor to another in a page. r=adamlock sr=alecf a=asa. Approved by ADT.

This commit is contained in:
radha%netscape.com 2005-08-18 11:16:37 +00:00
Родитель 8f0201019d
Коммит 3892d56d4a
3 изменённых файлов: 28 добавлений и 7 удалений

Просмотреть файл

@ -95,6 +95,10 @@ attribute boolean saveLayoutStateFlag;
/** attribute to indicate whether the page is already expired in cache */
attribute boolean expirationStatus;
/** Set/Get scrollers' positon in anchored pages */
void setScrollPosition(in PRInt32 x, in PRInt32 y);
void getScrollPosition(out PRInt32 x, out PRInt32 y);
/** Additional ways to create an entry */
void create(in nsIURI aURI, in wstring aTitle, in nsIDOMDocument aDocument,
in nsIInputStream aInputStream, in nsILayoutHistoryState aHistoryLayoutState,

Просмотреть файл

@ -69,6 +69,21 @@ NS_INTERFACE_MAP_END
//*****************************************************************************
// nsSHEntry: nsISHEntry
//*****************************************************************************
NS_IMETHODIMP nsSHEntry::SetScrollPosition(PRInt32 x, PRInt32 y)
{
mScrollPositionX = x;
mScrollPositionY = y;
return NS_OK;
}
NS_IMETHODIMP nsSHEntry::GetScrollPosition(PRInt32 *x, PRInt32 *y)
{
if (x && y) {
*x = mScrollPositionX;
*y = mScrollPositionY;
}
return NS_OK;
}
NS_IMETHODIMP nsSHEntry::GetURI(nsIURI** aURI)
{

Просмотреть файл

@ -57,13 +57,15 @@ private:
nsCOMPtr<nsIURI> mURI;
nsCOMPtr<nsIURI> mReferrerURI;
nsCOMPtr<nsIDOMDocument> mDocument;
nsString mTitle;
nsCOMPtr<nsIInputStream> mPostData;
nsCOMPtr<nsILayoutHistoryState> mLayoutHistoryState;
nsVoidArray mChildren;
PRUint32 mLoadType;
PRUint32 mID;
nsCOMPtr<nsIDOMDocument> mDocument;
nsString mTitle;
nsCOMPtr<nsIInputStream> mPostData;
nsCOMPtr<nsILayoutHistoryState> mLayoutHistoryState;
nsVoidArray mChildren;
PRUint32 mLoadType;
PRUint32 mID;
PRInt32 mScrollPositionX;
PRInt32 mScrollPositionY;
PRPackedBool mIsFrameNavigation;
PRPackedBool mSaveLayoutState;
PRPackedBool mExpired;