mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-04-02 12:32:55 +00:00
Fixed back button scrolling to scroll to top left corner b=39716, r=jst
This commit is contained in:
parent
8313fae417
commit
215a81d200
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user