Bug 875610 - Find in page throws r=mbrubeck

--HG--
extra : rebase_source : 84798bac6fb2a9c7ee03bd11e311bc7bbc66f2e9
This commit is contained in:
Rodrigo Silveira 2013-06-06 15:14:44 -07:00
parent e261036137
commit 0f7894bf64
3 changed files with 9 additions and 5 deletions

View File

@ -40,6 +40,9 @@ var FindHandler = {
return;
}
if (!this._fastFind.currentWindow)
return;
let selection = this._fastFind.currentWindow.getSelection();
if (!selection.rangeCount || selection.isCollapsed) {
// The selection can be into an input or a textarea element

View File

@ -3,6 +3,10 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* We don't support zooming yet, disable Animated zoom by clamping it to the default zoom. */
const kBrowserFindZoomLevelMin = 1;
const kBrowserFindZoomLevelMax = 1;
var FindHelperUI = {
type: "find",
commands: {
@ -175,8 +179,8 @@ var FindHelperUI = {
// Clamp the zoom level relatively to the default zoom level of the page
let defaultZoomLevel = Browser.selectedTab.getDefaultZoomLevel();
zoomLevel = Util.clamp(zoomLevel, (defaultZoomLevel * kBrowserFormZoomLevelMin),
(defaultZoomLevel * kBrowserFormZoomLevelMax));
zoomLevel = Util.clamp(zoomLevel, (defaultZoomLevel * kBrowserFindZoomLevelMin),
(defaultZoomLevel * kBrowserFindZoomLevelMax));
zoomLevel = Browser.selectedTab.clampZoomLevel(zoomLevel);
let zoomRect = Browser._getZoomRectForPoint(aElementRect.center().x, aElementRect.y, zoomLevel);

View File

@ -8,9 +8,6 @@
* - Provides autocomplete box for input fields.
*/
const kBrowserFormZoomLevelMin = 0.8;
const kBrowserFormZoomLevelMax = 2.0;
var FormHelperUI = {
_debugEvents: false,
_currentBrowser: null,