From 644356e330a7d460e2ad5991cb8fd90c0b962baa Mon Sep 17 00:00:00 2001 From: Jan Henning Date: Sun, 12 Feb 2017 13:33:42 +0100 Subject: [PATCH] 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 --HG-- extra : rebase_source : 04614d729a55e00c5331ecc321ca2ef5b5e73747 --- mobile/android/chrome/content/browser.js | 39 ------------------------ widget/android/nsIAndroidBridge.idl | 1 - 2 files changed, 40 deletions(-) diff --git a/mobile/android/chrome/content/browser.js b/mobile/android/chrome/content/browser.js index 730f73f35323..086dd13e828e 100644 --- a/mobile/android/chrome/content/browser.js +++ b/mobile/android/chrome/content/browser.js @@ -3430,10 +3430,6 @@ function Tab(aURL, aParams) { this.id = 0; this._parentId = -1; 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; @@ -4509,47 +4505,17 @@ Tab.prototype = { // 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; }, @@ -4560,7 +4526,6 @@ Tab.prototype = { OnHistoryGotoIndex: function(index, gotoURI) { Services.obs.notifyObservers(this.browser, "Content:HistoryChange", null); - this._updateZoomFromHistoryEvent("Goto"); return true; }, @@ -4656,10 +4621,6 @@ Tab.prototype = { return this.browser.contentWindow; }, - get scale() { - return this._zoom; - }, - QueryInterface: XPCOMUtils.generateQI([ Ci.nsIWebProgressListener, Ci.nsISHistoryListener, diff --git a/widget/android/nsIAndroidBridge.idl b/widget/android/nsIAndroidBridge.idl index bb185c037547..3145398c5bf1 100644 --- a/widget/android/nsIAndroidBridge.idl +++ b/widget/android/nsIAndroidBridge.idl @@ -9,7 +9,6 @@ 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)]