Closed Bug 1553689 Opened 5 years ago Closed 5 years ago

Slow page loading (or some such) stops us from using up-to-date scale value calculated by the minimum scale size

Categories

(Core :: Layout, defect, P3)

defect

Tracking

()

RESOLVED DUPLICATE of bug 1575093

People

(Reporter: hiro, Unassigned)

References

(Blocks 1 open bug, )

Details

I am still debugging the case on citilink.ru in https://webcompat.com/issues/27066 is not properly rendered, what I can tell right now is that we don't properly use the scale value based on the minimum scale size because mRestoreResolution check fails even if it's the first time to load the site.

And the mRestoreResolution is set via 'before-first-paint' event, MobileViewportManager::Observe -> MobileViewportManager::SetInitialViewport ->
MobileViewportManager::RefreshViewportSize -> MobileViewportManager::UpdateResolution -> PresShell::
SetResolutionAndScaleTo -> MobileViewportManager::ResolutionUpdated -> MobileViewportManager::SetRestoreResolution (because mPainted is false)

I don't yet understand what's going on there exactly but I am pretty sure this is not the same as bug 1544649.

(In reply to Hiroyuki Ikezoe (:hiro) from comment #0)

And the mRestoreResolution is set via 'before-first-paint' event, MobileViewportManager::Observe -> MobileViewportManager::SetInitialViewport ->
MobileViewportManager::RefreshViewportSize -> MobileViewportManager::UpdateResolution -> PresShell::
SetResolutionAndScaleTo -> MobileViewportManager::ResolutionUpdated -> MobileViewportManager::SetRestoreResolution (because mPainted is false)

This was wrong, probably I was seeing a different MVM instance. The mRestoreResolution was actually set via ShrinkgToDisplaySizeIfNeeded call in ScrollFrameHelper::ReflowFinished before we receive before-initial-paint event in MobileViewportManager, once it happens we never clear mRestoreResolution so that we don't have a chance to use the up-to-date scale. To fix the citilink.ru case we just need to reset mRestoreResolution in MobileViewportManager::SetInitialViewport right after the call of RefreshViewportSize, but it breaks session restore cases. We might need a way to tell the difference.

Anyways, I guess there are some other sites affected by this issue.

Confirmed that the patch for bug 1575093 fixed this. Thank you Botond!

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.