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; return;
} }
if (!this._fastFind.currentWindow)
return;
let selection = this._fastFind.currentWindow.getSelection(); let selection = this._fastFind.currentWindow.getSelection();
if (!selection.rangeCount || selection.isCollapsed) { if (!selection.rangeCount || selection.isCollapsed) {
// The selection can be into an input or a textarea element // 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 * 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/. */ * 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 = { var FindHelperUI = {
type: "find", type: "find",
commands: { commands: {
@ -175,8 +179,8 @@ var FindHelperUI = {
// Clamp the zoom level relatively to the default zoom level of the page // Clamp the zoom level relatively to the default zoom level of the page
let defaultZoomLevel = Browser.selectedTab.getDefaultZoomLevel(); let defaultZoomLevel = Browser.selectedTab.getDefaultZoomLevel();
zoomLevel = Util.clamp(zoomLevel, (defaultZoomLevel * kBrowserFormZoomLevelMin), zoomLevel = Util.clamp(zoomLevel, (defaultZoomLevel * kBrowserFindZoomLevelMin),
(defaultZoomLevel * kBrowserFormZoomLevelMax)); (defaultZoomLevel * kBrowserFindZoomLevelMax));
zoomLevel = Browser.selectedTab.clampZoomLevel(zoomLevel); zoomLevel = Browser.selectedTab.clampZoomLevel(zoomLevel);
let zoomRect = Browser._getZoomRectForPoint(aElementRect.center().x, aElementRect.y, zoomLevel); let zoomRect = Browser._getZoomRectForPoint(aElementRect.center().x, aElementRect.y, zoomLevel);

View File

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