Bug 628827 Blinky double-tap zoom and pinch to zoom r=mbrubeck
authorBenjamin Stover <bstover@mozilla.com>
Tue, 25 Jan 2011 16:19:46 -0800
changeset 67305 20e8529244f5a7c58a331829ae53a9543094e94d
parent 67304 fea6f774046d249765c9d8c8a5320930d8708d32
child 67306 22fbcfb60ada6b844bb186ebcc8457a7daee9d31
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmbrubeck
bugs628827
Bug 628827 Blinky double-tap zoom and pinch to zoom r=mbrubeck
mobile/chrome/content/AnimatedZoom.js
mobile/chrome/content/browser.js
--- a/mobile/chrome/content/AnimatedZoom.js
+++ b/mobile/chrome/content/AnimatedZoom.js
@@ -84,19 +84,21 @@ const AnimatedZoom = {
   },
 
   /** Update the visible rect, in device pixels relative to the content origin. */
   updateTo: function(nextRect) {
     let browser = getBrowser();
     let zoomRatio = window.innerWidth / nextRect.width;
     let zoomLevel = browser.scale * zoomRatio;
 
+    // We use _contentView and setScale because we do *not* want the displayport to update.
+    // XXX We need a new API, see bug 628799.
     let contentView = browser.getRootView();
     contentView.setScale(zoomLevel);
-    contentView.scrollTo(nextRect.left * zoomRatio, nextRect.top * zoomRatio);
+    contentView._contentView.scrollTo(nextRect.left * zoomRatio, nextRect.top * zoomRatio);
 
     this.zoomRect = nextRect;
   },
 
   /** Stop animation, zoom to point, and clean up. */
   finish: function() {
     window.removeEventListener("MozBeforePaint", this, false);
     Browser.setVisibleRect(this.zoomTo || this.zoomRect);
--- a/mobile/chrome/content/browser.js
+++ b/mobile/chrome/content/browser.js
@@ -1028,19 +1028,25 @@ var Browser = {
     let zoomRatio = window.innerWidth / rect.width;
     let zoomLevel = browser.scale * zoomRatio;
     let scrollX = rect.left * zoomRatio;
     let scrollY = rect.top * zoomRatio;
 
     this.hideSidebars();
     this.hideTitlebar();
 
-    browser.scale = this.selectedTab.clampZoomLevel(zoomLevel);
+    let scale = this.selectedTab.clampZoomLevel(zoomLevel);
+
+    // Use _contentView and setScale so that the displayport does not update.
+    // See bug 628799.
     let view = browser.getRootView();
-    view.scrollTo(scrollX, scrollY);
+    view.setScale(scale);
+    view._contentView.scrollTo(scrollX, scrollY);
+
+    browser.scale = scale;
   },
 
   zoomToPoint: function zoomToPoint(cX, cY, aRect) {
     let tab = this.selectedTab;
     if (!tab.allowZoom)
       return null;
 
     let zoomRect = null;