Closed Bug 1189879 Opened 7 years ago Closed 7 years ago

Fennec desktop mode temporarily uses a 480px viewport height

Categories

(Firefox for Android Graveyard :: Toolbar, defect)

All
Android
defect
Not set
normal

Tracking

(firefox42 fixed)

RESOLVED FIXED
Firefox 42
Tracking Status
firefox42 --- fixed

People

(Reporter: kats, Assigned: kats)

References

Details

Attachments

(1 file)

If desktop mode is enabled in Fennec, and updateViewportSize gets called in browser.js, then there are two calls to setBrowserSize. The first call at [1] sets a viewport height of 480 (which comes from [2]), and the second call at [3] sets a more correct viewport height (which is based on the screen dimensions and maintains the right aspect ratio). The first viewport height is just bogus and we shouldn't be doing that. It causes an unnecessary reflow and introduces a potential for the scroll position to get incorrectly clamped for no good reason.

[1] http://mxr.mozilla.org/mozilla-central/source/mobile/android/chrome/content/browser.js?rev=8bdfb76f8a08#4882
[2] http://mxr.mozilla.org/mozilla-central/source/mobile/android/chrome/content/browser.js?rev=8bdfb76f8a08#6605
[3] http://mxr.mozilla.org/mozilla-central/source/mobile/android/chrome/content/browser.js?rev=8bdfb76f8a08#4947
Attached patch PatchSplinter Review
Setting it to -1 causes updateViewportSize to recompute it based on the screen aspect ratio, which is what we want here.
Attachment #8641794 - Flags: review?(snorp)
Attachment #8641794 - Flags: review?(snorp) → review+
purely fyi / not directly related here, I'd suspected this codepath causing issues in my initial implementation of a test for the new Gecko SelectionCarets ...

On-the-fly zoomContraints calcs during tab/page loads seemed to cause (random orange) event coords to be scaled wrong if the tests ran early.

Structuring the test as [0] allowed for stability.

[0] http://mxr.mozilla.org/mozilla-central/source/mobile/android/tests/browser/robocop/testSelectionCarets.js?rev=101feffdaed8&mark=160-164,170-173#156
I'd find it strange if this patch fixed your test issues. Although yes, in general the initial load of pages causes pretty bad thrashing of the zoom constraints and and viewports and such. All that should be fixed by the move to APZ and the C++ counterparts to this code.
https://hg.mozilla.org/mozilla-central/rev/8c44dfae03c9
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 42
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.