Bug 605668 - Page offset to the left after two-Finger page-up/down gesture on a zoomed-in right side of the page [r=mbrubeck]

This commit is contained in:
Mark Finkle 2010-11-04 23:04:56 -04:00
parent bef1d22391
commit d95e100c45

View File

@ -476,14 +476,24 @@ var Browser = {
return this._tabs.map(function(tab) { return tab.browser; });
},
scrollContentToTop: function scrollContentToTop() {
this.contentScrollboxScroller.scrollTo(0, 0);
scrollContentToTop: function scrollContentToTop(aOptions) {
let x = {}, y = {};
this.contentScrollboxScroller.getPosition(x, y);
if (aOptions)
x.value = ("x" in aOptions ? aOptions.x : x.value);
this.contentScrollboxScroller.scrollTo(x.value, 0);
this.pageScrollboxScroller.scrollTo(0, 0);
},
// cmd_scrollBottom does not work in Fennec (Bug 590535).
scrollContentToBottom: function scrollContentToBottom() {
this.contentScrollboxScroller.scrollTo(0, Number.MAX_VALUE);
scrollContentToBottom: function scrollContentToBottom(aOptions) {
let x = {}, y = {};
this.contentScrollboxScroller.getPosition(x, y);
if (aOptions)
x.value = ("x" in aOptions ? aOptions.x : x.value);
this.contentScrollboxScroller.scrollTo(x.value, Number.MAX_VALUE);
this.pageScrollboxScroller.scrollTo(0, Number.MAX_VALUE);
},
@ -2318,7 +2328,7 @@ ProgressController.prototype = {
// We're about to have new page content, so scroll the content area
// to the top so the new paints will draw correctly.
// (background tabs are delayed scrolled to top in _documentStop)
Browser.scrollContentToTop();
Browser.scrollContentToTop({ x: 0 });
}
}
},