Bug 595403 - Can't scroll up after orientation change or resize [r=mbrubeck]

This commit is contained in:
Benjamin Stover 2010-09-17 15:54:38 -07:00
parent 5b57959fd9
commit b3729a408a
2 changed files with 11 additions and 1 deletions

View File

@ -149,6 +149,8 @@
case "MozScrolledAreaChanged":
this._contentDocumentWidth = aMessage.json.width;
this._contentDocumentHeight = aMessage.json.height;
// Recalculate whether the visible area is actually in bounds
this.scrollBy(0, 0);
this._updateCacheViewport();
break;
}

View File

@ -249,6 +249,14 @@ var Browser = {
for (let i = Browser.tabs.length - 1; i >= 0; i--)
Browser.tabs[i].updateViewportSize();
// XXX page scrollbox jumps to a strange value on resize. Scrolling it will
// bound it to a sane place, but not where we were when the resize began :(
Browser.hideTitlebar();
// XXX Hack. Browser also behaves badly on resize.
getBrowser().style.display = "none";
getBrowser().style.display = "block";
let curEl = document.activeElement;
if (curEl && curEl.scrollIntoView)
curEl.scrollIntoView(false);
@ -1084,7 +1092,7 @@ Browser.MainDragger.prototype = {
if (doffset.x > 0 && rect.left > 0)
x = Math.min(doffset.x, rect.left);
let height = document.getElementById("tile-stack").getBoundingClientRect().height;
let height = document.getElementById("content-viewport").getBoundingClientRect().height;
rect = Rect.fromRect(Browser.contentScrollbox.getBoundingClientRect()).map(Math.round);
if (doffset.y < 0 && rect.bottom < height)
y = Math.max(doffset.y, rect.bottom - height);