Bug 1425822 - Get rid of sanitizePrefs2.inContent.dialog.width and sanitizePrefs2.inContent.column.width. r?jaws draft
authorDão Gottwald <dao@mozilla.com>
Wed, 20 Dec 2017 15:10:48 +0100
changeset 713522 38a4a749b3cad27fe172755b1ff0f9679d5997d0
parent 713481 a235bf4868ab9e48c7b2f4bf4cc9bd949ca23c35
child 744349 9852650c9fca556b9ebd46835d80601db6c30872
push id93659
push userdgottwald@mozilla.com
push dateWed, 20 Dec 2017 14:11:10 +0000
reviewersjaws
bugs1425822
milestone59.0a1
Bug 1425822 - Get rid of sanitizePrefs2.inContent.dialog.width and sanitizePrefs2.inContent.column.width. r?jaws MozReview-Commit-ID: COB6zzorXYE
browser/components/preferences/sanitize.js
browser/components/preferences/sanitize.xul
browser/locales/en-US/chrome/browser/sanitize.dtd
--- a/browser/components/preferences/sanitize.js
+++ b/browser/components/preferences/sanitize.js
@@ -1,20 +1,15 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 4 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 var gSanitizeDialog = Object.freeze({
   init() {
-    let customWidthElements = document.getElementsByAttribute("dialogWidth", "*");
-    let isInSubdialog = document.documentElement.hasAttribute("subdialog");
-    for (let element of customWidthElements) {
-      element.style.width = element.getAttribute(isInSubdialog ? "subdialogWidth" : "dialogWidth");
-    }
     this.onClearHistoryChanged();
   },
 
   onClearHistoryChanged() {
     let downloadsPref = document.getElementById("privacy.clearOnShutdown.downloads");
     let historyPref = document.getElementById("privacy.clearOnShutdown.history");
     downloadsPref.value = historyPref.value;
   }
--- a/browser/components/preferences/sanitize.xul
+++ b/browser/components/preferences/sanitize.xul
@@ -14,18 +14,17 @@
   %brandDTD;
   %sanitizeDTD;
 ]>
 
 <prefwindow id="SanitizeDialog" type="child"
             xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
             dlgbuttons="accept,cancel,help"
             ondialoghelp="openPrefsHelp()"
-            dialogWidth="&sanitizePrefs2.modal.width;"
-            subdialogWidth="&sanitizePrefs2.inContent.dialog.width;"
+            style="width: &sanitizePrefs2.modal.width;"
             title="&sanitizePrefs2.title;"
             onload="gSanitizeDialog.init();">
 
   <script type="application/javascript" src="chrome://browser/content/utilityOverlay.js"/>
   <script type="application/javascript" src="chrome://browser/content/preferences/sanitize.js"/>
 
   <prefpane id="SanitizeDialogPane"
             helpTopic="prefs-clear-private-data">
@@ -43,18 +42,17 @@
     </preferences>
 
     <description>&clearDataSettings3.label;</description>
 
     <groupbox orient="horizontal">
       <caption><label>&historySection.label;</label></caption>
       <grid flex="1">
         <columns>
-          <column dialogWidth="&sanitizePrefs2.column.width;"
-                  subdialogWidth="&sanitizePrefs2.inContent.column.width;"/>
+          <column style="width: &sanitizePrefs2.column.width;"/>
           <column flex="1"/>
         </columns>
         <rows>
           <row>
             <checkbox label="&itemHistoryAndDownloads.label;"
                       accesskey="&itemHistoryAndDownloads.accesskey;"
                       preference="privacy.clearOnShutdown.history"/>
             <checkbox label="&itemCookies.label;"
@@ -76,18 +74,17 @@
           </row>
         </rows>
       </grid>
     </groupbox>
     <groupbox orient="horizontal">
       <caption><label>&dataSection.label;</label></caption>
       <grid flex="1">
         <columns>
-          <column dialogWidth="&sanitizePrefs2.column.width;"
-                  subdialogWidth="&sanitizePrefs2.inContent.column.width;"/>
+          <column style="width: &sanitizePrefs2.column.width;"/>
           <column flex="1"/>
         </columns>
         <rows>
           <row>
             <checkbox label="&itemSitePreferences.label;"
                       accesskey="&itemSitePreferences.accesskey;"
                       preference="privacy.clearOnShutdown.siteSettings"/>
             <checkbox label="&itemOfflineApps.label;"
--- a/browser/locales/en-US/chrome/browser/sanitize.dtd
+++ b/browser/locales/en-US/chrome/browser/sanitize.dtd
@@ -3,24 +3,16 @@
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
 <!ENTITY sanitizePrefs2.title          "Settings for Clearing History">
 <!-- LOCALIZATION NOTE (sanitizePrefs2.modal.width): width of the Clear History on Shutdown dialog.
      Should be large enough to contain the item* strings on a single line.
      The column width should be set at half of the dialog width. -->
 <!ENTITY sanitizePrefs2.modal.width    "34em">
 <!ENTITY sanitizePrefs2.column.width   "17em">
-<!-- LOCALIZATION NOTE (sanitizePrefs2.inContent.dialog.width): width of the
-     Clear History on Shutdown subdialog in the in-content preferences.
-     Should be large enough to contain the item* strings on a single line.
-     The column width adjusts the width of the first column in the dialog.
-     You can set the column width to a value that makes the dialog look visually balanced,
-     or at half of the dialog width if unsure. -->
-<!ENTITY sanitizePrefs2.inContent.dialog.width "34em">
-<!ENTITY sanitizePrefs2.inContent.column.width "17em">
 
 <!ENTITY sanitizeDialog2.title         "Clear Recent History">
 <!-- LOCALIZATION NOTE (sanitizeDialog2.width): width of the Clear Recent History dialog -->
 <!ENTITY sanitizeDialog2.width         "34em">
 
 <!ENTITY clearDataSettings3.label     "When I quit &brandShortName;, it should automatically clear all">
 
 <!-- XXX rearrange entities to match physical layout when l10n isn't an issue -->