mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 416661 - Site specific zoom level shouldn't apply to image documents, r=gavin ui-r=faaborg
This commit is contained in:
parent
8f3afbc633
commit
9cfc9f9eb3
@ -287,7 +287,8 @@ var FullZoom = {
|
||||
* one.
|
||||
**/
|
||||
_applyPrefToSetting: function FullZoom__applyPrefToSetting(aValue) {
|
||||
if (!this.siteSpecific || gInPrintPreviewMode)
|
||||
if (!this.siteSpecific || gInPrintPreviewMode ||
|
||||
content.document instanceof Ci.nsIImageDocument)
|
||||
return;
|
||||
|
||||
try {
|
||||
@ -302,7 +303,8 @@ var FullZoom = {
|
||||
},
|
||||
|
||||
_applySettingToPref: function FullZoom__applySettingToPref() {
|
||||
if (!this.siteSpecific || gInPrintPreviewMode)
|
||||
if (!this.siteSpecific || gInPrintPreviewMode ||
|
||||
content.document instanceof Ci.nsIImageDocument)
|
||||
return;
|
||||
|
||||
var zoomLevel = ZoomManager.zoom;
|
||||
@ -310,7 +312,8 @@ var FullZoom = {
|
||||
},
|
||||
|
||||
_removePref: function FullZoom__removePref() {
|
||||
this._cps.removePref(gBrowser.currentURI, this.name);
|
||||
if (!(content.document instanceof Ci.nsIImageDocument))
|
||||
this._cps.removePref(gBrowser.currentURI, this.name);
|
||||
},
|
||||
|
||||
|
||||
|
@ -80,6 +80,8 @@ _BROWSER_FILES = browser_bug321000.js \
|
||||
plugin_both2.html \
|
||||
browser_alltabslistener.js \
|
||||
alltabslistener.html \
|
||||
zoom_test.html \
|
||||
browser_bug416661.js \
|
||||
$(NULL)
|
||||
|
||||
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
|
||||
|
46
browser/base/content/test/browser_bug416661.js
Normal file
46
browser/base/content/test/browser_bug416661.js
Normal file
@ -0,0 +1,46 @@
|
||||
var tabElm, zoomLevel;
|
||||
function start_test_prefNotSet() {
|
||||
tabElm.linkedBrowser.removeEventListener("load", start_test_prefNotSet, true);
|
||||
tabElm.linkedBrowser.addEventListener("load", continue_test_prefNotSet, true);
|
||||
|
||||
is(ZoomManager.zoom, 1, "initial zoom level should be 1");
|
||||
FullZoom.enlarge();
|
||||
|
||||
//capture the zoom level to test later
|
||||
zoomLevel = ZoomManager.zoom;
|
||||
isnot(zoomLevel, 1, "zoom level should have changed");
|
||||
|
||||
content.location =
|
||||
"http://localhost:8888/browser/browser/base/content/test/moz.png";
|
||||
}
|
||||
|
||||
function continue_test_prefNotSet () {
|
||||
tabElm.linkedBrowser.removeEventListener("load", continue_test_prefNotSet, true);
|
||||
tabElm.linkedBrowser.addEventListener("load", end_test_prefNotSet, true);
|
||||
|
||||
is(ZoomManager.zoom, 1, "zoom level pref should not apply to an image");
|
||||
FullZoom.reset();
|
||||
|
||||
content.location =
|
||||
"http://localhost:8888/browser/browser/base/content/test/zoom_test.html";
|
||||
}
|
||||
|
||||
function end_test_prefNotSet() {
|
||||
is(ZoomManager.zoom, zoomLevel, "the zoom level should have persisted");
|
||||
|
||||
gBrowser.removeCurrentTab();
|
||||
finish();
|
||||
}
|
||||
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
tabElm = gBrowser.addTab();
|
||||
gBrowser.selectedTab = tabElm;
|
||||
tabElm.linkedBrowser.addEventListener("load", start_test_prefNotSet, true);
|
||||
|
||||
content.location =
|
||||
"http://localhost:8888/browser/browser/base/content/test/zoom_test.html";
|
||||
|
||||
}
|
14
browser/base/content/test/zoom_test.html
Normal file
14
browser/base/content/test/zoom_test.html
Normal file
@ -0,0 +1,14 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=416661
|
||||
-->
|
||||
<head>
|
||||
<title>Test for zoom setting</title>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=416661">Bug 416661</a>
|
||||
<p>Site specific zoom settings should not apply to image documents.</p>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user