diff --git a/browser/base/content/browser-textZoom.js b/browser/base/content/browser-textZoom.js index 1d1ffbf22e22..d947ebdd359d 100644 --- a/browser/base/content/browser-textZoom.js +++ b/browser/base/content/browser-textZoom.js @@ -327,17 +327,19 @@ var FullZoom = { * one. **/ _applyPrefToSetting: function FullZoom__applyPrefToSetting(aValue, aBrowser) { + var browser = aBrowser || gBrowser.selectedBrowser; + if (!this.siteSpecific || gInPrintPreviewMode || - content.document instanceof Ci.nsIImageDocument) + browser.contentDocument instanceof Ci.nsIImageDocument) return; try { if (typeof aValue != "undefined") - ZoomManager.setZoomForBrowser(aBrowser || gBrowser, this._ensureValid(aValue)); + ZoomManager.setZoomForBrowser(browser, this._ensureValid(aValue)); else if (typeof this.globalValue != "undefined") - ZoomManager.setZoomForBrowser(aBrowser || gBrowser, this.globalValue); + ZoomManager.setZoomForBrowser(browser, this.globalValue); else - ZoomManager.setZoomForBrowser(aBrowser || gBrowser, 1); + ZoomManager.setZoomForBrowser(browser, 1); } catch(ex) {} }, diff --git a/browser/base/content/test/browser_bug386835.js b/browser/base/content/test/browser_bug386835.js index f0d1ae3b4e88..17f12925315f 100644 --- a/browser/base/content/test/browser_bug386835.js +++ b/browser/base/content/test/browser_bug386835.js @@ -1,4 +1,5 @@ var gTestPage = "http://example.org/browser/browser/base/content/test/dummy_page.html"; +var gTestImage = "http://example.org/browser/browser/base/content/test/moz.png"; var gTab1, gTab2, gTab3; var gLevel; @@ -44,13 +45,23 @@ function thirdPageLoaded() { zoomTest(gTab2, gLevel, "Tab 2 should be zoomed now"); zoomTest(gTab3, gLevel, "Tab 3 should still be zoomed"); + load(gTab1, gTestImage, imageLoaded); +} + +function imageLoaded() { + zoomTest(gTab1, 1, "Zoom should be 1 when image was loaded in the background"); + gBrowser.selectedTab = gTab1; + zoomTest(gTab1, 1, "Zoom should still be 1 when tab with image is selected"); + finishTest(); } function finishTest() { FullZoom.reset(); gBrowser.removeTab(gTab1); + FullZoom.reset(); gBrowser.removeTab(gTab2); + FullZoom.reset(); gBrowser.removeTab(gTab3); finish(); }