Bug 628633 - [Regression] Find in Page does not scroll down when hitting the Down Arrow from the findbar [r=mfinkle,mbrubeck]
--- a/mobile/chrome/content/common-ui.js
+++ b/mobile/chrome/content/common-ui.js
@@ -555,24 +555,32 @@ var FindHelperUI = {
updateCommands: function findHelperUpdateCommands(aValue) {
let disabled = (this._status == Ci.nsITypeAheadFind.FIND_NOTFOUND) || (aValue == "");
this._cmdPrevious.setAttribute("disabled", disabled);
this._cmdNext.setAttribute("disabled", disabled);
},
_zoom: function _findHelperZoom(aElementRect) {
- // Zoom to a specified Rect
- if (aElementRect && Browser.selectedTab.allowZoom && Services.prefs.getBoolPref("findhelper.autozoom")) {
+ let autozoomEnabled = Services.prefs.getBoolPref("findhelper.autozoom");
+ if (!aElementRect || !autozoomEnabled)
+ return;
+
+ if (Browser.selectedTab.allowZoom) {
let zoomLevel = Browser._getZoomLevelForRect(aElementRect);
zoomLevel = Math.min(Math.max(kBrowserFormZoomLevelMin, zoomLevel), kBrowserFormZoomLevelMax);
zoomLevel = Browser.selectedTab.clampZoomLevel(zoomLevel);
let zoomRect = Browser._getZoomRectForPoint(aElementRect.center().x, aElementRect.y, zoomLevel);
AnimatedZoom.animateTo(zoomRect);
+ } else {
+ // Even if zooming is disabled we could need to reposition the view in
+ // order to keep the element on-screen
+ let zoomRect = Browser._getZoomRectForPoint(aElementRect.center().x, aElementRect.y, getBrowser().scale);
+ AnimatedZoom.animateTo(zoomRect);
}
}
};
/**
* Responsible for navigating forms and filling in information.
* - Navigating forms is handled by next and previous commands.
* - When an element is focused, the browser view zooms in to the control.