Bug 1201529 - Prevent calls to set the resolution or displayport from browser.js when APZ is enabled. r=rbarker
authorKartikaya Gupta <kgupta@mozilla.com>
Fri, 11 Sep 2015 21:58:16 -0400
changeset 294691 3ed4f8be62508f0e3a9117c40307d1b2fe46e963
parent 294690 10cbae31c4b7af412519f1d5c6c9ee9ec9cdb6f5
child 294692 18f719dfea70838c6cd48772405f95533103e7fe
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrbarker
bugs1201529
milestone43.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 1201529 - Prevent calls to set the resolution or displayport from browser.js when APZ is enabled. r=rbarker
mobile/android/chrome/content/browser.js
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -3737,16 +3737,22 @@ Tab.prototype = {
     let scrollPortHeight = screenHeight * factor;
 
     let win = this.browser.contentWindow;
     win.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils).
         setScrollPositionClampingScrollPortSize(scrollPortWidth, scrollPortHeight);
   },
 
   setViewport: function(aViewport) {
+    if (AppConstants.MOZ_ANDROID_APZ) {
+      // This should already be getting short-circuited out in GeckoLayerClient,
+      // but this is an extra safety precaution
+      return;
+    }
+
     // Transform coordinates based on zoom
     let x = aViewport.x / aViewport.zoom;
     let y = aViewport.y / aViewport.zoom;
 
     this.setScrollClampingSize(aViewport.zoom);
 
     let win = this.browser.contentWindow;
     win.scrollTo(x, y);
@@ -3756,16 +3762,19 @@ Tab.prototype = {
     this.userScrollPos.y = win.scrollY;
     this.setResolution(aViewport.zoom, false);
 
     if (aViewport.displayPort)
       this.setDisplayPort(aViewport.displayPort);
   },
 
   setResolution: function(aZoom, aForce) {
+    if (AppConstants.MOZ_ANDROID_APZ) {
+      return;
+    }
     // Set zoom level
     if (aForce || !fuzzyEquals(aZoom, this._zoom)) {
       this._zoom = aZoom;
       if (BrowserApp.selectedTab == this) {
         let cwu = this.browser.contentWindow.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils);
         this._drawZoom = aZoom;
         cwu.setResolutionAndScaleTo(aZoom / window.devicePixelRatio);
       }
@@ -3829,16 +3838,19 @@ Tab.prototype = {
         viewport.pageBottom = (viewport.cssPageBottom * viewport.zoom);
       }
     }
 
     return viewport;
   },
 
   sendViewportUpdate: function(aPageSizeUpdate) {
+    if (AppConstants.MOZ_ANDROID_APZ) {
+      return;
+    }
     let viewport = this.getViewport();
     let displayPort = Services.androidBridge.getDisplayPort(aPageSizeUpdate, BrowserApp.isBrowserContentDocumentDisplayed(), this.id, viewport);
     if (displayPort != null)
       this.setDisplayPort(displayPort);
   },
 
   // These constants are used to prioritize high quality metadata over low quality data, so that
   // we can collect data as we find meta tags, and replace low quality metadata with higher quality