Bug 481391 - Image document test in FullZoom._applyPrefToSetting fails for background tabs. r=gavin

This commit is contained in:
Dão Gottwald 2009-03-08 07:42:54 +01:00
Родитель 26a9445d9d
Коммит 32e4200f24
2 изменённых файлов: 17 добавлений и 4 удалений

Просмотреть файл

@ -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) {}
},

Просмотреть файл

@ -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();
}