Bug 599419 - FormHelper tries to zoom outside the page's allowed range [r=mbrubeck]
authorWesley Johnston <wjohnston>
Tue, 28 Sep 2010 13:53:00 -0700
changeset 66818 46e90cc5d42973646d1ec5bee24f2a171b1eb114
parent 66817 72fd73b0f631a718fe25f0e345dbe2605fc1401c
child 66819 6fd63fcc1c4bdd1e71bfcc4c451a450af7f2a2c4
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)
reviewersmbrubeck
bugs599419
Bug 599419 - FormHelper tries to zoom outside the page's allowed range [r=mbrubeck]
mobile/chrome/content/browser-ui.js
--- a/mobile/chrome/content/browser-ui.js
+++ b/mobile/chrome/content/browser-ui.js
@@ -2022,17 +2022,18 @@ var FormHelperUI = {
         harmonizedCaretY = aElementRect.y;
         aCaretRect.x = aElementRect.x;
       }
 
       let zoomLevel = browser.scale;
       let enableZoom = Browser.selectedTab.allowZoom && Services.prefs.getBoolPref("formhelper.autozoom");
       if (enableZoom) {
         zoomLevel = (viewAreaHeight / caretLines) / harmonizedCaretHeight;
-        zoomLevel = Math.min(Math.max(kBrowserFormZoomLevelMin, zoomLevel), kBrowserFormZoomLevelMax);
+        zoomLevel = Util.clamp(zoomLevel, kBrowserFormZoomLevelMin, kBrowserFormZoomLevelMax);
+        zoomLevel = Browser.selectedTab.clampZoomLevel(zoomLevel);
       }
       viewAreaWidth /= zoomLevel;
 
       const margin = Services.prefs.getIntPref("formhelper.margin");
 
       // if the viewAreaWidth is smaller than the neutralized position + margins.
       // [YES] use the x position of the element minus margins as x position for our visible rect.
       // [NO] use the x position of the caret minus margins as the x position for our visible rect.