Bug 1337325 - Remove unused zoom and scroll code from browser.js r?kats
More JPZ leftovers, I presume. In any case what's left doesn't do anything really useful and a DXR search didn't reveal any remaining users, so this can be thrown out.
MozReview-Commit-ID: 9dN6Jifpbvw
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -3424,20 +3424,16 @@ nsBrowserAccess.prototype = {
};
function Tab(aURL, aParams) {
this.filter = null;
this.browser = null;
this.id = 0;
this.lastTouchedAt = Date.now();
- this._zoom = 1.0;
- this._drawZoom = 1.0;
- this._restoreZoom = false;
- this.userScrollPos = { x: 0, y: 0 };
this.contentDocumentIsDisplayed = true;
this.pluginDoorhangerTimeout = null;
this.shouldShowPluginDoorhanger = true;
this.clickToPlayPluginsActivated = false;
this.desktopMode = false;
this.originalURI = null;
this.hasTouchListener = false;
this.playingAudio = false;
@@ -4490,68 +4486,37 @@ Tab.prototype = {
// notifications using nsBrowserStatusFilter.
},
onStatusChange: function(aBrowser, aWebProgress, aRequest, aStatus, aMessage) {
// Note: aWebProgess and aRequest will be NULL since we are filtering webprogress
// notifications using nsBrowserStatusFilter.
},
- _getGeckoZoom: function() {
- let res = {};
- let cwu = this.browser.contentWindow.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils);
- cwu.getResolution(res);
- let zoom = res.value * window.devicePixelRatio;
- return zoom;
- },
-
- saveSessionZoom: function(aZoom) {
- let cwu = this.browser.contentWindow.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils);
- cwu.setResolutionAndScaleTo(aZoom / window.devicePixelRatio);
- },
-
- restoredSessionZoom: function() {
- let cwu = this.browser.contentWindow.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils);
-
- if (this._restoreZoom && cwu.isResolutionSet) {
- return this._getGeckoZoom();
- }
- return null;
- },
-
- _updateZoomFromHistoryEvent: function(aHistoryEventName) {
- // Restore zoom only when moving in session history, not for new page loads.
- this._restoreZoom = aHistoryEventName !== "New";
- },
-
OnHistoryNewEntry: function(newURI, oldIndex) {
Services.obs.notifyObservers(this.browser, "Content:HistoryChange", null);
- this._updateZoomFromHistoryEvent("New");
},
OnHistoryGoBack: function(backURI) {
Services.obs.notifyObservers(this.browser, "Content:HistoryChange", null);
- this._updateZoomFromHistoryEvent("Back");
return true;
},
OnHistoryGoForward: function(forwardURI) {
Services.obs.notifyObservers(this.browser, "Content:HistoryChange", null);
- this._updateZoomFromHistoryEvent("Forward");
return true;
},
OnHistoryReload: function(reloadURI, reloadFlags) {
Services.obs.notifyObservers(this.browser, "Content:HistoryChange", null);
return true;
},
OnHistoryGotoIndex: function(index, gotoURI) {
Services.obs.notifyObservers(this.browser, "Content:HistoryChange", null);
- this._updateZoomFromHistoryEvent("Goto");
return true;
},
OnHistoryPurge: function(numEntries) {
Services.obs.notifyObservers(this.browser, "Content:HistoryChange", null);
return true;
},
@@ -4633,20 +4598,16 @@ Tab.prototype = {
// nsIBrowserTab
get window() {
if (!this.browser)
return null;
return this.browser.contentWindow;
},
- get scale() {
- return this._zoom;
- },
-
QueryInterface: XPCOMUtils.generateQI([
Ci.nsIWebProgressListener,
Ci.nsISHistoryListener,
Ci.nsIObserver,
Ci.nsISupportsWeakReference,
Ci.nsIBrowserTab
])
};
--- a/widget/android/nsIAndroidBridge.idl
+++ b/widget/android/nsIAndroidBridge.idl
@@ -4,17 +4,16 @@
#include "nsISupports.idl"
interface mozIDOMWindowProxy;
[scriptable, uuid(e8420a7b-659b-4325-968b-a114a6a067aa)]
interface nsIBrowserTab : nsISupports {
readonly attribute mozIDOMWindowProxy window;
- readonly attribute float scale;
};
[scriptable, uuid(08426a73-e70b-4680-9282-630932e2b2bb)]
interface nsIUITelemetryObserver : nsISupports {
void startSession(in wstring name,
in long long timestamp);
void stopSession(in wstring name,
in wstring reason,