Bug 547927 - Page layout broken if some wider page has been visited before [r=mark.finkle]
authorVivien Nicolas <21@vingtetun.org>
Fri, 02 Apr 2010 10:31:08 -0400
changeset 66094 aa810de909daf84d380222e4e6481f513d7cdcca
parent 66093 17f076e9ca0bbd6fc1de563e1fbf98991e3765a0
child 66095 0fd2ca7a773db7813711f24648fd4933747cc003
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmark
bugs547927
Bug 547927 - Page layout broken if some wider page has been visited before [r=mark.finkle]
mobile/chrome/content/browser.js
--- a/mobile/chrome/content/browser.js
+++ b/mobile/chrome/content/browser.js
@@ -2890,30 +2890,34 @@ Tab.prototype = {
         viewportW = viewportH * (screenW / screenH);
       } else {
         viewportW = kDefaultBrowserWidth;
         viewportH = kDefaultBrowserWidth * (screenH / screenW);
       }
       browser.className = "browser-viewport";
       browser.style.width = viewportW + "px";
       browser.style.height = viewportH + "px";
-    } else if (browser.contentDocument instanceof XULDocument) {
-       // XXX XUL documents do not receive scroll change event
+    } else {
+      browser.className = "browser";
+      browser.style.removeProperty("width");
+      browser.style.removeProperty("height");
+    }
+
+    // Some documents are not firing MozScrolledAreaChanged and/or fired it for
+    // sub-documents only
+    let doc = browser.contentDocument;
+    if (doc instanceof XULDocument || doc.body instanceof HTMLFrameSetElement) {
        let [w, h] = BrowserView.Util.getBrowserDimensions(browser);
        let event = document.createEvent("Event");
        event.initEvent("MozScrolledAreaChanged", true, false);
        event.x = 0;
        event.y = 0;
        event.width = w;
        event.height = h;
        browser.dispatchEvent(event);
-    } else {
-      browser.className = "browser";
-      browser.style.removeProperty("width");
-      browser.style.removeProperty("height");
     }
 
     this.setIcon(browser.mIconURL);
     this._loading = false;
 
     if (this == Browser.selectedTab) {
       let bv = Browser._browserView;
       bv.ignorePageScroll(false);