Closed Bug 828345 Opened 7 years ago Closed 7 years ago

Fixed position elements jitter when snapping back from zooming out beyond page bounds

Categories

(Firefox for Android :: Toolbar, defect)

All
Android
defect
Not set

Tracking

()

RESOLVED FIXED
Firefox 21

People

(Reporter: cwiiis, Assigned: cwiiis)

Details

Attachments

(1 file)

If you zoom out so that there is blank area on both sides of an axis, then let go, there are usually a few frames where the fixed position elements will appear to jump position. This is because the clamping scroll-port does not maintain aspect ratio in these situations. Patch incoming.
Attachment #699824 - Flags: review?(bugmail.mozilla)
Comment on attachment 699824 [details] [diff] [review]
Maintain clamping scrollport aspect ratio

Review of attachment 699824 [details] [diff] [review]:
-----------------------------------------------------------------

LGTM

::: mobile/android/chrome/content/browser.js
@@ +3134,5 @@
>      let [pageWidth, pageHeight] = this.getPageSize(this.browser.contentDocument,
>                                                     viewportWidth, viewportHeight);
> +
> +    let factor = Math.min(viewportWidth / gScreenWidth, pageWidth / gScreenWidth,
> +                          viewportHeight / gScreenHeight, pageHeight / gScreenHeight);

I would prefer renaming "factor" to "scrollPortAspectRatio" or adding a comment. Also I didn't know Math.min could take an arbitrary number of arguments, cool!
Attachment #699824 - Flags: review?(bugmail.mozilla) → review+
https://hg.mozilla.org/mozilla-central/rev/1f3d5f4cc05c
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 21
You need to log in before you can comment on or make changes to this bug.