gecko-dev/mobile
Jan Henning 14cc31c7f4 Bug 1279443 - Don't capture session state during startup before we've restored history. r=sebastian
When restoring tabs on startup, the Java UI creates tab stubs for the tabs from the previous session. The selected foreground tab then starts loading as soon as Gecko is up and running. Meanwhile, the session store gets initialised, too and starts restoring history and other things for that tab.

After history has been restored for an active tab, the session store reloads the current history entry, however by that time, depending on device speed, page size and how many other tabs the session store has to process during startup, the initial page load might have progressed far enough to have already triggered various events monitored by the session store, e.g. "pageshow".

If those events arrive before tab restoring has finished, the session store will attempt to capture that tab's state, which will overwrite the values stored from the previous session. Once the page is then reloaded for restoring, wrong values (e.g. form data, scroll position, zoom level) might then be restored.

Therefore, we now abort any attempts to capture a tab's state
- for all tabs until the "sessionstore-windows-restored" notification has been received as a signal that the initial session restore during startup has finished
- for the restored foreground tab until the location change notification is received after reloading

MozReview-Commit-ID: HbhXcEUnRXQ

--HG--
extra : transplant_source : h%2C%DA%27%28%F0%9F%8F%15-%21F/b%18%B5%DF%F4.%BE
2016-06-29 18:24:13 +02:00
..
android Bug 1279443 - Don't capture session state during startup before we've restored history. r=sebastian 2016-06-29 18:24:13 +02:00
locales Bug 1264705 - Add Qwant search plugin for mobile. r=florian,flod 2016-06-22 09:04:53 -05:00