Closed Bug 1189879 Opened 7 years ago Closed 7 years ago
Fennec desktop mode temporarily uses a 480px viewport height
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  sets a viewport height of 480 (which comes from ), and the second call at  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.  http://mxr.mozilla.org/mozilla-central/source/mobile/android/chrome/content/browser.js?rev=8bdfb76f8a08#4882  http://mxr.mozilla.org/mozilla-central/source/mobile/android/chrome/content/browser.js?rev=8bdfb76f8a08#6605  http://mxr.mozilla.org/mozilla-central/source/mobile/android/chrome/content/browser.js?rev=8bdfb76f8a08#4947
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)
7 years ago
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  allowed for stability.  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.
You need to log in before you can comment on or make changes to this bug.