Bug 342635 - wrong scroll behaviour after loading new page while session restoring. r=dietrich

This commit is contained in:
Simon Bünzli 2008-09-06 05:42:39 +02:00
parent fd23220e6f
commit 78649b88bb

View File

@ -1785,6 +1785,10 @@ SessionStoreService.prototype = {
}
}
// don't restore text data and scrolling state if the user has navigated
// away before the loading completed (except for in-page navigation)
if (!this.__SS_restore_data.url || this.currentURI.spec.replace(/#.*/, "") ==
this.__SS_restore_data.url.replace(/#.*/, "")) {
var content = aEvent.originalTarget.defaultView;
if (this.currentURI.spec == "about:config") {
// unwrap the document for about:config because otherwise the properties
@ -1797,6 +1801,7 @@ SessionStoreService.prototype = {
var event = this.ownerDocument.createEvent("Events");
event.initEvent("SSTabRestored", true, false);
this.__SS_restore_tab.dispatchEvent(event);
}
this.removeEventListener("load", this.__SS_restore, true);
delete this.__SS_restore_data;