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 2183 fbccbe691b6a5bfe4d44f22e328d0bcd1c32eb42
parent 2182 6eadac9795e4908feca96b4671afc492d06cc0d9
child 2184 e2d47c85f2feaecd8a394c87c362895cb3e31ba3
push id1838
push usermbrubeck@mozilla.com
push dateMon, 11 Oct 2010 19:02:47 +0000
reviewersmbrubeck
bugs599419
Bug 599419 - FormHelper tries to zoom outside the page's allowed range [r=mbrubeck]
chrome/content/browser-ui.js
--- a/chrome/content/browser-ui.js
+++ b/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.