From 75f6410e2cf609ab442ce6c3060587e0b6756e73 Mon Sep 17 00:00:00 2001 From: Kartikaya Gupta Date: Thu, 19 Apr 2012 20:55:25 -0500 Subject: [PATCH] Bug 732016 - Re-enable scroll clamping but set the desired scrollport using the new scrollport API. r=Cwiiis a=fennec --- mobile/android/chrome/content/browser.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mobile/android/chrome/content/browser.js b/mobile/android/chrome/content/browser.js index 1277452a0e4..9d2d7516aa7 100644 --- a/mobile/android/chrome/content/browser.js +++ b/mobile/android/chrome/content/browser.js @@ -1560,7 +1560,6 @@ Tab.prototype = { 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; @@ -1726,8 +1725,10 @@ Tab.prototype = { let x = aViewport.x / aViewport.zoom; let y = aViewport.y / aViewport.zoom; - // Set scroll position + // Set scroll-port size and scroll position (both in CSS pixels) 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;