Bug 621610 - Compatibility: Amazon.com sign-in issues [r=mfinkle]
authorVivien Nicolas <21@vingtetun.org>
Tue, 04 Jan 2011 15:52:05 +0100
changeset 67202 c34f1e8ffbe76549b256eebd12db10b0bd44d180
parent 67201 096154dce06b94652329f4b677b0efd0712d3b84
child 67203 96527fcfe62cb0cf6590155cc38f334d95cac05f
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs621610
Bug 621610 - Compatibility: Amazon.com sign-in issues [r=mfinkle]
mobile/chrome/content/browser-ui.js
--- a/mobile/chrome/content/browser-ui.js
+++ b/mobile/chrome/content/browser-ui.js
@@ -2138,23 +2138,28 @@ var FormHelperUI = {
   },
 
   /** Zoom and move viewport so that element is legible and touchable. */
   _zoom: function _formHelperZoom(aElementRect, aCaretRect) {
     let browser = getBrowser();
     let zoomRect = Rect.fromRect(browser.getBoundingClientRect());
 
     // Zoom to a specified Rect
-    if (aElementRect && Browser.selectedTab.allowZoom && Services.prefs.getBoolPref("formhelper.autozoom")) {
+    let autozoomEnabled = Services.prefs.getBoolPref("formhelper.autozoom");
+    if (aElementRect && Browser.selectedTab.allowZoom && autozoomEnabled) {
       this._currentElementRect = aElementRect;
       // Zoom to an element by keeping the caret into view
       let zoomLevel = Browser.selectedTab.clampZoomLevel(this._getZoomLevelForRect(aElementRect));
 
       zoomRect = Browser._getZoomRectForPoint(aElementRect.center().x, aElementRect.y, zoomLevel);
       Browser.animatedZoomTo(zoomRect);
+    } else if (aElementRect && !Browser.selectedTab.allowZoom && autozoomEnabled) {
+      // Even if zooming is disabled we could need to reposition the view in
+      // order to keep the element on-screen
+      Browser.animatedZoomTo(zoomRect);
     }
 
     this._ensureCaretVisible(aCaretRect);
   },
 
   _ensureCaretVisible: function _ensureCaretVisible(aCaretRect) {
     if (!aCaretRect)
       return;