Reset RestoreResolution when initial viewport
Categories
(Core :: Layout, enhancement)
Tracking
()
People
(Reporter: noiseyou99, Unassigned)
Details
Attachments
(1 file)
|
557 bytes,
patch
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.101 Safari/537.36
Steps to reproduce:
It can't reproduce on Firefox RDM, it just can reproduce on KaiOS device, reload [1] and sometime it will get the incorrect viewport.
[1] http://hzrd.tcl-ta.com:9000/wap/
I think maybe we can reset RestoreResolution when initial viewport
Should I reset RestoreResolution when initial viewport as attachment?
Comment 2•4 years ago
|
||
Thanks for the bug report. Though I haven't looked at the test case, I don't think clearing mRestoreResolution in SetInitinalViewport is the right thing to do, it will break setting the resolution when we restore the last session.
Can you please clarify why you think we should do it?
The normal case resolution is 0.25, I think the mRestoreResolution was keeping so the calculation state is different from normal case, the log as below,
normal case
=== execute reload ===
nsDocShell::Reload: aReloadFlags:0
nsDocShell::Reload: loadType: 2
DOCSHELL 0x9b60f000 InternalLoad http://hzrd.tcl-ta.com:9000/WAP/
nsHtml5StreamParser::GuessEncoding mTreeBuilder->NeedsCharsetSwitchTo
operator() mTreeBuilder->NeedsCharsetSwitchTo
CharsetChangeReloadDocument reload
nsDocShell::Reload: aReloadFlags:1024
nsDocShell::Reload: loadType: 67108866
DOCSHELL 0x9b60f000 InternalLoad http://hzrd.tcl-ta.com:9000/WAP/
PresShell::SetResolutionAndScaleTo aResolution:1.000000
UpdateResolutionForFirstPaint
PresShell::SetResolutionAndScaleTo aResolution:1.000000
PresShell::SetResolutionAndScaleTo aResolution:0.250000
PresShell::SetResolutionAndScaleTo aResolution:1.000000
UpdateResolutionForFirstPaint
PresShell::SetResolutionAndScaleTo aResolution:1.000000
PresShell::SetResolutionAndScaleTo aResolution:0.250000
NG case:
=== execute reload ===
nsDocShell::Reload: aReloadFlags:0
nsDocShell::Reload: loadType: 2
DOCSHELL 0x9b60f000 InternalLoad http://hzrd.tcl-ta.com:9000/WAP/
nsHtml5StreamParser::GuessEncoding mTreeBuilder->NeedsCharsetSwitchTo
PresShell::SetResolutionAndScaleTo aResolution:0.250000
operator() mTreeBuilder->NeedsCharsetSwitchTo
CharsetChangeReloadDocument reload
nsDocShell::Reload: aReloadFlags:1024
nsDocShell::Reload: loadType: 67108866
DOCSHELL 0x9b60f000 InternalLoad http://hzrd.tcl-ta.com:9000/WAP/
PresShell::SetResolutionAndScaleTo aResolution:1.000000
PresShell::SetResolutionAndScaleTo aResolution:1.000000
UpdateResolutionForFirstPaint
PresShell::SetResolutionAndScaleTo aResolution:1.000000
Comment 4•4 years ago
|
||
A question is, where the 1.0 value comes from? It looks to me that we should stop calling SetResolutionAndScaleTo with 1.0 in this case, though it depends on where it comes from. Some of the call might be right things to do.
Comment 5•4 years ago
|
||
Anyways, the comment 3 doesn't explain why we should reset mRestoreResolution in SetInitinalViewport, it does just explain what happened.
(In reply to Hiroyuki Ikezoe (:hiro) from comment #5)
Anyways, the comment 3 doesn't explain why we should reset mRestoreResolution in SetInitinalViewport, it does just explain what happened.
Because it set the mRestoreResolution when NG case first reload, and second reload will check mRestoreResolution on MobileViewportManager::UpdateResolutionForFirstPaint , so the NG case and normal case execute different ApplyNewZoom path.
(In reply to Hiroyuki Ikezoe (:hiro) from comment #4)
A question is, where the 1.0 value comes from? It looks to me that we should stop calling SetResolutionAndScaleTo with 1.0 in this case, though it depends on where it comes from. Some of the call might be right things to do.
I think in normal case it also get 1.0 value in calculation process.
In firefox RDM with url: http://hzrd.tcl-ta.com:9000/WAP/ log as below,
@@@ nsDocShell::Reload: aReloadFlags:0
@@@ nsDocShell::Reload: loadType: 2
@@@ nsHtml5StreamParser::GuessEncoding mTreeBuilder->NeedsCharsetSwitchTo
@@@ PresShell::SetResolutionAndScaleTo aResolution:0.250000
@@@ operator() mTreeBuilder->NeedsCharsetSwitchTo
@@@ nsDocShell::Reload: aReloadFlags:1024
@@@ nsDocShell::Reload: loadType: 67108866
@@@ PresShell::SetResolutionAndScaleTo aResolution:1.000000
@@@ MobileViewportManager::SetInitialViewport
@@@ MobileViewportManager::UpdateResolutionForFirstPaint
@@@ PresShell::SetResolutionAndScaleTo aResolution:0.250000
@@@ PresShell::SetResolutionAndScaleTo aResolution:0.250000
@@@ PresShell::SetResolutionAndScaleTo aResolution:1.000000
@@@ MobileViewportManager::SetInitialViewport
@@@ MobileViewportManager::UpdateResolutionForFirstPaint
@@@ PresShell::SetResolutionAndScaleTo aResolution:0.250000
Description
•