Bug 1338088 - Capture the scroll position for DOMTitleChanged events after the initial page load sequence. r=ahunt

onTabLoad() means we've potentially navigated to a new page, in which case any auxiliary tab data we keep around for the currently loaded page only (form input data, scroll position) would be invalidated and shouldn't be preserved.

Since onTabLoad() can however also be triggered if e.g. just the tab title changed (an additional DOMTitleChanged event), we shouldn't throw away the old data without replacing it with the current state, though. We already do this for the form input data - we need to do it for the scroll position as well.

MozReview-Commit-ID: HG7g6L7htDG

--HG--
extra : rebase_source : 1f7aab26002ee71237dd0a48b872298b39ca7f13
This commit is contained in:
Jan Henning 2017-02-11 15:36:17 +01:00
Родитель 4609f2c8a8
Коммит f9183caf54
1 изменённых файлов: 4 добавлений и 0 удалений

Просмотреть файл

@ -720,6 +720,10 @@ SessionStore.prototype = {
// As _collectTabData() doesn't save any form data, we need to manually
// capture it to bridge the time until the next input event arrives.
this.onTabInput(aWindow, aBrowser);
// A similar thing applies for the scroll position, otherwise a stray
// DOMTitleChanged event can clobber the scroll position if the user
// doesn't scroll again afterwards.
this.onTabScroll(aWindow, aBrowser);
}
log("onTabLoad() ran for tab " + aWindow.BrowserApp.getTabForBrowser(aBrowser).id);