mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 11:55:49 +00:00
Bug 1237075 - Navigating from 'manual' to 'auto' session history entry should scroll the page, r=jst
--HG-- extra : rebase_source : c6d901084edf1b17e21c44515a0483c7fbcc77dd
This commit is contained in:
parent
ddf76b50b9
commit
fb35bc42f0
@ -10072,6 +10072,11 @@ nsDocShell::InternalLoad(nsIURI* aURI,
|
||||
}
|
||||
}
|
||||
|
||||
// If we're doing a history load, use its scroll restoration state.
|
||||
if (aSHEntry) {
|
||||
aSHEntry->GetScrollRestorationIsManual(&scrollRestorationIsManual);
|
||||
}
|
||||
|
||||
/* Assign mOSHE to mLSHE. This will either be a new entry created
|
||||
* by OnNewURI() for normal loads or aSHEntry for history loads.
|
||||
*/
|
||||
|
@ -82,6 +82,15 @@
|
||||
opener.is(window.scrollY, 0, "Shouldn't have scrolled back to the state3's position");
|
||||
opener.is(history.state.state, "state3", "Unexpected state.");
|
||||
|
||||
history.pushState({ state: "state5" }, "state5");
|
||||
history.scrollRestoration = "auto";
|
||||
document.getElementById("bottom").scrollIntoView();
|
||||
opener.isnot(window.scrollY, 0, "Should have scrolled to 'bottom'.");
|
||||
history.back();
|
||||
window.scrollTo(0, 0);
|
||||
history.forward();
|
||||
opener.isnot(window.scrollY, 0, "Should have scrolled back to the state5's position");
|
||||
|
||||
var ifr = document.createElement("iframe");
|
||||
ifr.src = "data:text/html,";
|
||||
document.body.appendChild(ifr);
|
||||
|
Loading…
Reference in New Issue
Block a user