Bug 680257 - Always call nsDocShell::ScrollToAnchor on short-circuited loads, so as to make sure the target pseudo-class is updated correctly. r=bz
This commit is contained in:
@@ -8452,13 +8452,13 @@ nsDocShell::InternalLoad(nsIURI * aURI,
|
||||
GetCurScrollPos(ScrollOrientation_X, &cx);
|
||||
GetCurScrollPos(ScrollOrientation_Y, &cy);
|
||||
|
||||
// We scroll whenever we're not doing a history load. Note that
|
||||
// sometimes we might scroll even if we don't fire a hashchange
|
||||
// event! See bug 653741.
|
||||
if (!aSHEntry) {
|
||||
rv = ScrollToAnchor(curHash, newHash, aLoadType);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
// ScrollToAnchor doesn't necessarily cause us to scroll the window;
|
||||
// the function decides whether a scroll is appropriate based on the
|
||||
// arguments it receives. But even if we don't end up scrolling,
|
||||
// ScrollToAnchor performs other important tasks, such as informing
|
||||
// the presShell that we have a new hash. See bug 680257.
|
||||
rv = ScrollToAnchor(curHash, newHash, aLoadType);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
mLoadType = aLoadType;
|
||||
mURIResultedInDocument = PR_TRUE;
|
||||
|
||||
Reference in New Issue
Block a user