Bug 732016 - Re-enable scroll clamping but set the desired scrollport using the new scrollport API. r=Cwiiis a=fennec

This commit is contained in:
Kartikaya Gupta 2012-04-19 20:55:25 -05:00
parent be2da87d6f
commit 75f6410e2c

View File

@ -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;