Bug 701627 - slashdot.org doesn't fire MozScrolledAreaChanged events as the page gets bigger while loading. r=mfinkle
authorDoug Turner <dougt@dougt.org>
Mon, 28 Nov 2011 21:40:53 -0800
changeset 83610 82f3392976b4a487dd93bc41566c02f01aefe62a
parent 83609 fe5c5000bc2dd9e271cddf6586f0bd7db0182061
child 83611 beea574981d2a462c98435951c80736cdc7b6dda
push id519
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 00:38:35 +0000
treeherdermozilla-beta@788ea1ef610b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs701627
milestone11.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 701627 - slashdot.org doesn't fire MozScrolledAreaChanged events as the page gets bigger while loading. r=mfinkle
mobile/android/chrome/content/browser.js
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -1047,22 +1047,24 @@ Tab.prototype = {
 
   get viewport() {
     // Update the viewport to current dimensions
     this._viewport.x = this.browser.contentWindow.scrollX +
                        this.viewportExcess.x;
     this._viewport.y = this.browser.contentWindow.scrollY +
                        this.viewportExcess.y;
 
-    let doc = this.browser.contentDocument.documentElement;
+    let doc = this.browser.contentDocument;
     let pageWidth = this._viewport.width;
     let pageHeight = this._viewport.height;
     if (doc != null) {
-      pageWidth = Math.max(pageWidth, doc.scrollWidth);
-      pageHeight = Math.max(pageHeight, doc.scrollHeight);
+	let body = doc.body || {};
+	let html = doc.documentElement || {};
+	pageWidth = Math.max(body.scrollWidth || 1, html.scrollWidth);
+	pageHeight = Math.max(body.scrollHeight || 1, html.scrollHeight);
     }
 
     // Transform coordinates based on zoom
     this._viewport.x = Math.round(this._viewport.x * this._viewport.zoom);
     this._viewport.y = Math.round(this._viewport.y * this._viewport.zoom);
     this._viewport.pageWidth = Math.round(pageWidth * this._viewport.zoom);
     this._viewport.pageHeight = Math.round(pageHeight * this._viewport.zoom);