Fixed back button scrolling to scroll to top left corner b=39716, r=jst

git-svn-id: svn://10.0.0.236/trunk@70746 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
locka%iol.ie
2000-05-24 17:18:10 +00:00
parent a6d0dde7ef
commit 52c73e6671

View File

@@ -2681,7 +2681,7 @@ NS_IMETHODIMP nsDocShell::StopCurrentLoads()
NS_IMETHODIMP nsDocShell::ScrollIfAnchor(nsIURI* aURI, PRBool* aWasAnchor)
{
NS_ASSERTION(aURI, "null uri arg");
NS_ASSERTION(aURI, "null anchor arg");
NS_ASSERTION(aWasAnchor, "null anchor arg");
if (aURI == nsnull || aWasAnchor == nsnull)
{
@@ -2775,17 +2775,14 @@ NS_IMETHODIMP nsDocShell::ScrollIfAnchor(nsIURI* aURI, PRBool* aWasAnchor)
rv = GetPresShell(getter_AddRefs(shell));
if (NS_SUCCEEDED(rv) && shell)
{
*aWasAnchor = PR_TRUE;
rv = shell->GoToAnchor(sNewRef);
if (NS_SUCCEEDED(rv))
{
*aWasAnchor = PR_TRUE;
}
}
}
else
{
// A bit of a hack - scroll to the top of the page.
SetCurScrollPos(ScrollOrientation_Y, 0);
SetCurScrollPosEx(0, 0);
*aWasAnchor = PR_TRUE;
}