Bug 511982: handle pages scrolling themselves by causing the appropriate redraw (fixes acid2), r=froystig

This commit is contained in:
Vivien Nicolas 2009-08-30 02:37:06 -04:00
parent cb16e9bd73
commit c8a00b5633

View File

@ -391,6 +391,7 @@ BrowserView.prototype = {
if (currentBrowser) {
currentBrowser.removeEventListener("MozAfterPaint", this.handleMozAfterPaint, false);
currentBrowser.removeEventListener("scroll", this.handlePageScroll, false);
// !!! --- RESIZE HACK BEGIN -----
// change to the real event type and perhaps refactor the handler function name
@ -411,6 +412,7 @@ BrowserView.prototype = {
this.beginBatchOperation();
browser.addEventListener("MozAfterPaint", this.handleMozAfterPaint, false);
browser.addEventListener("scroll", this.handlePageScroll, false);
// !!! --- RESIZE HACK BEGIN -----
// change to the real event type and perhaps refactor the handler function name
@ -463,6 +465,16 @@ BrowserView.prototype = {
tm.dirtyRects(rects, this.isRendering());
},
handlePageScroll: function handlePageScroll(aEvent) {
if (aEvent.target != this._browser.contentDocument)
return;
let [scrollX, scrollY] = BrowserView.Util.getContentScrollValues(this._browser);
Browser.contentScrollboxScroller.scrollTo(this.browserToViewport(scrollX),
this.browserToViewport(scrollY));
this.onAfterVisibleMove();
},
// !!! --- RESIZE HACK BEGIN -----
simulateMozAfterSizeChange: function simulateMozAfterSizeChange() {
let [w, h] = BrowserView.Util.getBrowserDimensions(this._browser);