Bug 1337325 - Remove unused zoom and scroll code from browser.js r=kats
authorJan Henning <jh+bugzilla@buttercookie.de>
Sun, 12 Feb 2017 13:33:42 +0100
changeset 394132 3f7919d071569b8b75dc2ff817178027d021ab0d
parent 394131 1257608f7fc6e4a73b6110dac7f7622ff385077a
child 394133 a3859b017684597459fccd2648f4be46f72513d7
push id1468
push userasasaki@mozilla.com
push dateMon, 05 Jun 2017 19:31:07 +0000
treeherdermozilla-release@0641fc6ee9d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs1337325
milestone54.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
mobile/android/chrome/content/browser.js
widget/android/nsIAndroidBridge.idl
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -3425,20 +3425,16 @@ nsBrowserAccess.prototype = {
 
 
 function Tab(aURL, aParams) {
   this.filter = null;
   this.browser = null;
   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;
   this.clickToPlayPluginsActivated = false;
   this.desktopMode = false;
   this.originalURI = null;
   this.hasTouchListener = false;
   this.playingAudio = false;
@@ -4504,68 +4500,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;
   },
 
@@ -4651,20 +4616,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,