Closed Bug 1498657 Opened 6 years ago Closed 3 years ago

Investigate doing scroll position restoring earlier

Categories

(Firefox for Android Graveyard :: Session Restore, enhancement, P3)

All
Android
enhancement

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: JanH, Assigned: JanH)

Details

Desktop restores scroll positions when the "load" event fires. We on the other hand wait until "pageshow" because we need to restore the pinch zoom first (e.g. on a page with width=device-width, horizontal scrolling is only possible if you zoom in first) and the MobileViewportManager might not get round to doing so until the "load" event itself.

However instead of waiting for "pageshow", a better idea might be to just call setTimout(0) (respectively whatever our new helper method for that use case was called) in order to restore the scroll position more quickly, but still be certain that the MVM has restored the document resolution first.
Having though a little about it, an even better idea might be to hook into the mRestorePos logic in nsGfxScrollFrame - that way we could start setting the scroll position earlier, but would keep trying to scroll further if necessary if more content keeps loading. It would also better handle giving up if the user starts scrolling.
We'd still need to be careful about the resolution/pinch-zoom restoring, as nsGfxScrollFrame depends on reflows to trigger another attempt of scrolling to the target position, and changing the pinch-zoom by itself probably wouldn't trigger a reflow, so we might need some extra way of notifying nsGfxScroll frame that the pinch-zoom changed and it can now do another attempt of scrolling to the target position.

If we're actually going with this idea, then the Desktop session store should be updated to the new logic, too.
We have completed our launch of our new Firefox on Android. The development of the new versions use GitHub for issue tracking. If the bug report still reproduces in a current version of [Firefox on Android nightly](https://play.google.com/store/apps/details?id=org.mozilla.fenix) an issue can be reported at the [Fenix GitHub project](https://github.com/mozilla-mobile/fenix/). If you want to discuss your report please use [Mozilla's chat](https://wiki.mozilla.org/Matrix#Connect_to_Matrix) server https://chat.mozilla.org and join the [#fenix](https://chat.mozilla.org/#/room/#fenix:mozilla.org) channel.
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → INCOMPLETE
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.