Back out 89833e1b3016 (bug 707571) as it is broken with the new maple rewrite. r=backout
authorKartikaya Gupta <kgupta@mozilla.com>
Tue, 13 Mar 2012 17:11:28 -0400
changeset 89350 70fe7536c40c02b32bf6aedf8220f402dfdaef4e
parent 89349 0742dd20781ed02fbd3a0342c02ac737e4b76a3b
child 89351 aa8f8734d99700ea24214b9f14dc8aec9e0ea48e
push id22242
push userkgupta@mozilla.com
push dateWed, 14 Mar 2012 15:19:09 +0000
treeherdermozilla-central@936ef50fa498 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs707571
milestone13.0a1
backs out89833e1b3016786c52ae928dd4cd21fd3146d6a5
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
Back out 89833e1b3016 (bug 707571) as it is broken with the new maple rewrite. r=backout
mobile/android/base/gfx/ImmutableViewportMetrics.java
mobile/android/base/gfx/ViewportMetrics.java
mobile/android/base/ui/PanZoomController.java
mobile/android/chrome/content/browser.js
--- a/mobile/android/base/gfx/ImmutableViewportMetrics.java
+++ b/mobile/android/base/gfx/ImmutableViewportMetrics.java
@@ -19,31 +19,29 @@ public class ImmutableViewportMetrics {
     // because Java doesn't have the concept of const classes
     public final float pageSizeWidth;
     public final float pageSizeHeight;
     public final float viewportRectBottom;
     public final float viewportRectLeft;
     public final float viewportRectRight;
     public final float viewportRectTop;
     public final float zoomFactor;
-    public final boolean allowZoom;
 
     public ImmutableViewportMetrics(ViewportMetrics m) {
         RectF viewportRect = m.getViewport();
         viewportRectBottom = viewportRect.bottom;
         viewportRectLeft = viewportRect.left;
         viewportRectRight = viewportRect.right;
         viewportRectTop = viewportRect.top;
 
         FloatSize pageSize = m.getPageSize();
         pageSizeWidth = pageSize.width;
         pageSizeHeight = pageSize.height;
 
         zoomFactor = m.getZoomFactor();
-        allowZoom = m.getAllowZoom();
     }
 
     public float getWidth() {
         return viewportRectRight - viewportRectLeft;
     }
 
     public float getHeight() {
         return viewportRectBottom - viewportRectTop;
@@ -64,13 +62,9 @@ public class ImmutableViewportMetrics {
                          viewportRectTop,
                          viewportRectRight,
                          viewportRectBottom);
     }
 
     public FloatSize getPageSize() {
         return new FloatSize(pageSizeWidth, pageSizeHeight);
     }
-
-    public boolean getAllowZoom() {
-        return allowZoom;
-    }
 }
--- a/mobile/android/base/gfx/ViewportMetrics.java
+++ b/mobile/android/base/gfx/ViewportMetrics.java
@@ -58,57 +58,51 @@ import android.util.Log;
  * the page viewport for the Gecko layer client to use.
  */
 public class ViewportMetrics {
     private static final String LOGTAG = "GeckoViewportMetrics";
 
     private FloatSize mPageSize;
     private RectF mViewportRect;
     private float mZoomFactor;
-    private boolean mAllowZoom;
 
     public ViewportMetrics() {
         DisplayMetrics metrics = new DisplayMetrics();
         GeckoApp.mAppContext.getWindowManager().getDefaultDisplay().getMetrics(metrics);
 
         mPageSize = new FloatSize(metrics.widthPixels, metrics.heightPixels);
         mViewportRect = new RectF(0, 0, metrics.widthPixels, metrics.heightPixels);
         mZoomFactor = 1.0f;
-        mAllowZoom = true;
     }
 
     public ViewportMetrics(ViewportMetrics viewport) {
         mPageSize = new FloatSize(viewport.getPageSize());
         mViewportRect = new RectF(viewport.getViewport());
         mZoomFactor = viewport.getZoomFactor();
-        mAllowZoom = viewport.mAllowZoom;
     }
 
     public ViewportMetrics(ImmutableViewportMetrics viewport) {
         mPageSize = new FloatSize(viewport.pageSizeWidth, viewport.pageSizeHeight);
         mViewportRect = new RectF(viewport.viewportRectLeft,
                                   viewport.viewportRectTop,
                                   viewport.viewportRectRight,
                                   viewport.viewportRectBottom);
         mZoomFactor = viewport.zoomFactor;
-        mAllowZoom = viewport.allowZoom;
     }
 
 
     public ViewportMetrics(JSONObject json) throws JSONException {
         float x = (float)json.getDouble("x");
         float y = (float)json.getDouble("y");
         float width = (float)json.getDouble("width");
         float height = (float)json.getDouble("height");
         float pageWidth = (float)json.getDouble("pageWidth");
         float pageHeight = (float)json.getDouble("pageHeight");
         float zoom = (float)json.getDouble("zoom");
 
-        mAllowZoom = json.getBoolean("allowZoom");
-
         mPageSize = new FloatSize(pageWidth, pageHeight);
         mViewportRect = new RectF(x, y, x + width, y + height);
         mZoomFactor = zoom;
     }
 
     public PointF getOrigin() {
         return new PointF(mViewportRect.left, mViewportRect.top);
     }
@@ -144,20 +138,16 @@ public class ViewportMetrics {
     public FloatSize getPageSize() {
         return mPageSize;
     }
 
     public float getZoomFactor() {
         return mZoomFactor;
     }
 
-    public boolean getAllowZoom() {
-        return mAllowZoom;
-    }
-
     public void setPageSize(FloatSize pageSize) {
         mPageSize = pageSize;
     }
 
     public void setViewport(RectF viewport) {
         mViewportRect = viewport;
     }
 
--- a/mobile/android/base/ui/PanZoomController.java
+++ b/mobile/android/base/ui/PanZoomController.java
@@ -767,19 +767,16 @@ public class PanZoomController
 
     @Override
     public boolean onScale(SimpleScaleGestureDetector detector) {
         Log.d(LOGTAG, "onScale in state " + mState);
 
         if (GeckoApp.mDOMFullScreen)
             return false;
 
-        if (!mController.getViewportMetrics().getAllowZoom())
-            return false;
-
         if (mState == PanZoomState.ANIMATED_ZOOM)
             return false;
 
         float prevSpan = detector.getPreviousSpan();
         if (FloatUtils.fuzzyEquals(prevSpan, 0.0f)) {
             // let's eat this one to avoid setting the new zoom to infinity (bug 711453)
             return true;
         }
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -1652,18 +1652,16 @@ Tab.prototype = {
         pageWidth = Math.max(body.scrollWidth, html.scrollWidth);
         pageHeight = Math.max(body.scrollHeight, html.scrollHeight);
       }
 
       /* Transform the page width and height based on the zoom factor. */
       pageWidth *= viewport.zoom;
       pageHeight *= viewport.zoom;
 
-      viewport.allowZoom  = this.metadata.allowZoom;
-
       /*
        * Avoid sending page sizes of less than screen size before we hit DOMContentLoaded, because
        * this causes the page size to jump around wildly during page load. After the page is loaded,
        * send updates regardless of page size; we'll zoom to fit the content as needed.
        */
       if (doc.readyState === 'complete' || (pageWidth >= gScreenWidth && pageHeight >= gScreenHeight)) {
         viewport.pageWidth = pageWidth;
         viewport.pageHeight = pageHeight;