From ffe427c1259b35b69ca9f6048a0f96ee5e95a061 Mon Sep 17 00:00:00 2001 From: Jared Wein Date: Thu, 5 Feb 2015 09:09:23 -0500 Subject: [PATCH] Bug 1128177 - Dialog to clear data when exiting Firefox needs more space between two columns (in-content preferences). r=Gijs --HG-- extra : rebase_source : 6e348fb56dfdd0cb7e6ea80a4a02464792655c71 --- .../components/preferences/in-content/subdialogs.js | 3 +++ browser/components/preferences/sanitize.js | 9 +++++++++ browser/components/preferences/sanitize.xul | 11 +++++++---- browser/locales/en-US/chrome/browser/sanitize.dtd | 8 ++++++++ 4 files changed, 27 insertions(+), 4 deletions(-) diff --git a/browser/components/preferences/in-content/subdialogs.js b/browser/components/preferences/in-content/subdialogs.js index 547b9bfdca46..62c67ea51857 100644 --- a/browser/components/preferences/in-content/subdialogs.js +++ b/browser/components/preferences/in-content/subdialogs.js @@ -110,6 +110,9 @@ let gSubDialog = { this.injectXMLStylesheet(styleSheetURL); } + // Provide the ability for the dialog to know that it is being loaded "in-content". + this._frame.contentDocument.documentElement.setAttribute("subdialog", "true"); + // Make window.close calls work like dialog closing. let oldClose = this._frame.contentWindow.close; this._frame.contentWindow.close = function() { diff --git a/browser/components/preferences/sanitize.js b/browser/components/preferences/sanitize.js index a685b80d0be4..353ab7fc7531 100644 --- a/browser/components/preferences/sanitize.js +++ b/browser/components/preferences/sanitize.js @@ -4,6 +4,15 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ let gSanitizeDialog = Object.freeze({ + init: function() { + let customWidthElements = document.getElementsByAttribute("dialogWidth", "*"); + let isInSubdialog = document.documentElement.hasAttribute("subdialog"); + for (let element of customWidthElements) { + element.style.width = element.getAttribute(isInSubdialog ? "subdialogWidth" : "dialogWidth"); + } + onClearHistoryChanged(); + }, + onClearHistoryChanged: function () { let downloadsPref = document.getElementById("privacy.clearOnShutdown.downloads"); let historyPref = document.getElementById("privacy.clearOnShutdown.history"); diff --git a/browser/components/preferences/sanitize.xul b/browser/components/preferences/sanitize.xul index fd511ab73413..a8cdfee01ba8 100644 --- a/browser/components/preferences/sanitize.xul +++ b/browser/components/preferences/sanitize.xul @@ -19,9 +19,10 @@ xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" dlgbuttons="accept,cancel,help" ondialoghelp="openPrefsHelp()" - style="width: &dialog.width2;;" + dialogWidth="&dialog.width2;" + subdialogWidth="&inContentDialog.width;" title="&sanitizePrefs2.title;" - onload="gSanitizeDialog.onClearHistoryChanged();"> + onload="gSanitizeDialog.init();">