Bug 1035629 - Convert most Privacy pane dialogs to be in-content. r=MattN
authorRichard Marti <richard.marti@gmail.com>
Mon, 04 Aug 2014 18:58:13 -0700
changeset 197748 3b35a8e4da0e551cc47530a90d9226025092042b
parent 197747 fdabd8fe19c019169aeba40265613211922699b8
child 197749 02b52b8da6f4c2c5323d35db8d50ae2e952753cc
push id8045
push usermozilla@noorenberghe.ca
push dateTue, 05 Aug 2014 02:01:17 +0000
treeherderfx-team@02b52b8da6f4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMattN
bugs1035629
milestone34.0a1
Bug 1035629 - Convert most Privacy pane dialogs to be in-content. r=MattN
browser/components/preferences/in-content/privacy.js
browser/components/preferences/in-content/subdialogs.js
--- a/browser/components/preferences/in-content/privacy.js
+++ b/browser/components/preferences/in-content/privacy.js
@@ -464,29 +464,26 @@ var gPrivacyPane = {
     var bundlePreferences = document.getElementById("bundlePreferences");
     var params = { blockVisible   : true,
                    sessionVisible : true,
                    allowVisible   : true,
                    prefilledHost  : "",
                    permissionType : "cookie",
                    windowTitle    : bundlePreferences.getString("cookiepermissionstitle"),
                    introText      : bundlePreferences.getString("cookiepermissionstext") };
-    openDialog("chrome://browser/content/preferences/permissions.xul",
-               "Browser:Permissions",
-               "modal=yes", params);
+    gSubDialog.open("chrome://browser/content/preferences/permissions.xul",
+                    null, params);
   },
 
   /**
    * Displays all the user's cookies in a dialog.
    */
   showCookies: function (aCategory)
   {
-    openDialog("chrome://browser/content/preferences/cookies.xul",
-               "Browser:Cookies",
-               "modal=yes", null);
+    gSubDialog.open("chrome://browser/content/preferences/cookies.xul");
   },
 
   // CLEAR PRIVATE DATA
 
   /*
    * Preferences:
    *
    * privacy.sanitize.sanitizeOnShutdown
@@ -494,18 +491,17 @@ var gPrivacyPane = {
    *   Clear Private Data settings, false otherwise
    */
 
   /**
    * Displays the Clear Private Data settings dialog.
    */
   showClearPrivateDataSettings: function ()
   {
-    openDialog("chrome://browser/content/preferences/sanitize.xul",
-               "modal=yes", null);
+    gSubDialog.open("chrome://browser/content/preferences/sanitize.xul");
   },
 
 
   /**
    * Displays a dialog from which individual parts of private data may be
    * cleared.
    */
   clearPrivateDataNow: function (aClearEverything)
--- a/browser/components/preferences/in-content/subdialogs.js
+++ b/browser/components/preferences/in-content/subdialogs.js
@@ -129,16 +129,21 @@ let gSubDialog = {
   },
 
   _onLoad: function(aEvent) {
     if (aEvent.target.contentWindow.location == "about:blank")
       return;
 
     // Do this on load to wait for the CSS to load and apply before calculating the size.
     let docEl = this._frame.contentDocument.documentElement;
+
+    // padding-bottom doesn't seem to be included in the scrollHeight of the document element in XUL
+    // so add it ourselves.
+    let paddingBottom = parseFloat(this._frame.contentWindow.getComputedStyle(docEl).paddingBottom);
+
     this._frame.style.width = docEl.style.width || docEl.scrollWidth + "px";
-    this._frame.style.height = docEl.style.height || docEl.scrollHeight + "px";
+    this._frame.style.height = docEl.style.height || (docEl.scrollHeight + paddingBottom) + "px";
 
     this._overlay.style.visibility = "visible";
     this._frame.focus();
     this._overlay.style.opacity = ""; // XXX: focus hack continued from _onContentLoaded
   },
 };