Bug 732016 - Re-enable scroll clamping but set the desired scrollport using the new scrollport API. r=Cwiiis a=lsblakk
authorKartikaya Gupta <kgupta@mozilla.com>
Tue, 24 Apr 2012 13:52:37 -0500
changeset 95549 a38075d6e6d0d504ea0a5826334616d48bd4a27a
parent 95548 e08b460bcb6090cd5b6b8d982bf6d30245c249e8
child 95550 7525533b3e42c8d7e47c1f8850518f640824cf2b
push id886
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 19:57:52 +0000
treeherdermozilla-beta@bbd8d5efd6d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersCwiiis, lsblakk
bugs732016
milestone14.0a2
Bug 732016 - Re-enable scroll clamping but set the desired scrollport using the new scrollport API. r=Cwiiis a=lsblakk
mobile/android/chrome/content/browser.js
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -1555,17 +1555,16 @@ Tab.prototype = {
 
     // Must be called after appendChild so the docshell has been created.
     this.setActive(false);
 
     this.browser.stop();
 
     let frameLoader = this.browser.QueryInterface(Ci.nsIFrameLoaderOwner).frameLoader;
     frameLoader.renderMode = Ci.nsIFrameLoader.RENDER_MODE_ASYNC_SCROLL;
-    frameLoader.clampScrollPosition = false;
 
     // only set tab uri if uri is valid
     let uri = null;
     try {
       uri = Services.io.newURI(aURL, null, null).spec;
     } catch (e) {}
 
     this.id = ++gTabIDFactory;
@@ -1847,16 +1846,18 @@ Tab.prototype = {
 
   setViewport: function(aViewport) {
     // Transform coordinates based on zoom
     let x = aViewport.x / aViewport.zoom;
     let y = aViewport.y / aViewport.zoom;
 
     // Set scroll position
     let win = this.browser.contentWindow;
+    win.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils).setScrollPositionClampingScrollPortSize(
+        gScreenWidth / aViewport.zoom, gScreenHeight / aViewport.zoom);
     win.scrollTo(x, y);
     this.userScrollPos.x = win.scrollX;
     this.userScrollPos.y = win.scrollY;
     this.setResolution(aViewport.zoom, false);
     this.setDisplayPort(aViewport.displayPort);
   },
 
   setResolution: function(aZoom, aForce) {