Bug 574683 - Local XUL pages (about:config) are not rendering [r=vingtetun]
authorMark Finkle <mfinkle@mozilla.com>
Fri, 25 Jun 2010 11:28:42 -0400
changeset 66319 8c8588171a14e98868f1cec462137f19ba9a5971
parent 66318 6e1cc8e8c5681267b7630e135bc429ea028ec15f
child 66320 fec39f4839580ff603cf8d7c2dfb2ab3795eaa5b
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)
reviewersvingtetun
bugs574683
Bug 574683 - Local XUL pages (about:config) are not rendering [r=vingtetun]
mobile/chrome/content/BrowserView.js
mobile/chrome/content/bindings/browser.xml
mobile/chrome/content/browser-ui.js
mobile/chrome/content/browser.js
--- a/mobile/chrome/content/BrowserView.js
+++ b/mobile/chrome/content/BrowserView.js
@@ -172,16 +172,25 @@ BrowserView.Util = {
     container.style.width = visibleRect.width  + 'px';
     container.style.height = visibleRect.height + 'px';
     container.style.overflow = '-moz-hidden-unscrollable';
   },
 
   resizeContainerToViewport: function resizeContainerToViewport(container, viewportRect) {
     container.style.width = viewportRect.width  + 'px';
     container.style.height = viewportRect.height + 'px';
+  },
+
+  ensureMozScrolledAreaEvent: function ensureMozScrolledAreaEvent(aBrowser, aWidth, aHeight) {
+    let message = {};
+    message.target = aBrowser;
+    message.name = "Browser:MozScrolledAreaChanged";
+    message.json = { width: aWidth, height: aHeight };
+
+    Browser._browserView.updateScrolledArea(message);
   }
 };
 
 BrowserView.prototype = {
 
   // -----------------------------------------------------------
   // Public instance methods
   //
--- a/mobile/chrome/content/bindings/browser.xml
+++ b/mobile/chrome/content/bindings/browser.xml
@@ -413,17 +413,17 @@
           gotoIndex: function(aIndex) { this._sendMessage("WebNavigation:GotoIndex", {index: aIndex}); },
           loadURI: function(aURI, aLoadFlags, aReferrer, aPostData, aHeaders) {
             this._currentURI = this._browser._ios.newURI(aURI, null, null);
             this._browser._contentTitle = "";
             this._sendMessage("WebNavigation:LoadURI", {uri: aURI, flags: aLoadFlags});
           },
           reload: function(aReloadFlags) { this._sendMessage("WebNavigation:Reload", {flags: aReloadFlags}); },
           stop: function(aStopFlags) { this._sendMessage("WebNavigation:Stop", {flags: aStopFlags}); },
-          get document() { debugger; Components.utils.reportError("contentDocument is not available"); return null; },
+          get document() { Components.utils.reportError("contentDocument is not available"); return null; },
           get currentURI() {
             if (!this._currentURI)
                this._currentURI = this._browser._ios.newURI("about:blank", null, null);
 
             return this._currentURI;
           },
           set currentURI(aURI) { this.loadURI(aURI.spec, null, null, null); },
           referringURI: null,
--- a/mobile/chrome/content/browser-ui.js
+++ b/mobile/chrome/content/browser-ui.js
@@ -1169,19 +1169,21 @@ var PageActions = {
       filePath: picker.file.path
     };
 
     Browser.selectedBrowser.messageManager.sendAsyncMessage("Browser:SaveAs", data);
   },
 
   updatePageSaveAs: function updatePageSaveAs() {
     this.removeItems("saveas");
-    // XXX Not sure if we care about this
-    //if (Browser.selectedBrowser.contentDocument instanceof XULDocument)
-    //  return;
+
+    // Check for local XUL content
+    let contentDocument = Browser.selectedBrowser.contentDocument;
+    if (contentDocument && contentDocument instanceof XULDocument)
+      return;
 
     let strings = Elements.browserBundle;
     let node = this.appendItem("saveas", strings.getString("pageactions.saveas.pdf"), "");
     node.onclick = function(event) {
       PageActions._savePageAsPDF();
     }
   },
 
--- a/mobile/chrome/content/browser.js
+++ b/mobile/chrome/content/browser.js
@@ -2548,16 +2548,24 @@ Tab.prototype = {
       } else {
         viewportW = kDefaultBrowserWidth;
         viewportH = kDefaultBrowserWidth * (screenH / screenW);
       }
 
       browser.style.width = viewportW + "px";
       browser.style.height = viewportH + "px";
     }
+
+    // Local XUL documents are not firing MozScrolledAreaChanged
+    let contentDocument = browser.contentDocument;
+    if (contentDocument && contentDocument instanceof XULDocument) {
+      let width = contentDocument.documentElement.scrollWidth;
+      let height = contentDocument.documentElement.scrollHeight;
+      BrowserView.Util.ensureMozScrolledAreaEvent(browser, width, height);
+    }
   },
 
   startLoading: function startLoading() {
     if (this._loading) throw "Already Loading!";
 
     this._loading = true;
 
     let bv = Browser._browserView;