Bug 1442887 - Align the #clearDataSettings button in about:preferences to the very right. r=jaws
authorJohann Hofmann <jhofmann@mozilla.com>
Fri, 13 Apr 2018 11:34:38 +0200
changeset 466893 5d6c7b12169a4ff6cd79ef0cf9a55c897f4a31a8
parent 466892 eea1bfe5404db3705ef7d32c7a6f19a533531be7
child 466894 5067d8ae88c30bd7ba80f47e81f7f4d5240a3bbf
push id9165
push userasasaki@mozilla.com
push dateThu, 26 Apr 2018 21:04:54 +0000
treeherdermozilla-beta@064c3804de2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjaws
bugs1442887
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1442887 - Align the #clearDataSettings button in about:preferences to the very right. r=jaws MozReview-Commit-ID: ketCjIIUl0
browser/components/preferences/in-content/privacy.js
browser/components/preferences/in-content/privacy.xul
browser/components/preferences/in-content/tests/browser_search_subdialogs_within_preferences_site_data.js
browser/themes/shared/incontentprefs/preferences.inc.css
--- a/browser/components/preferences/in-content/privacy.js
+++ b/browser/components/preferences/in-content/privacy.js
@@ -616,16 +616,18 @@ var gPrivacyPane = {
    * value of the private browsing auto-start preference.
    */
   updatePrivacyMicroControls() {
     // Set "Keep cookies until..." to "I close Nightly" and disable the setting
     // when we're in auto private mode (or reset it back otherwise).
     document.getElementById("keepCookiesUntil").value = this.readKeepCookiesUntil();
     this.readAcceptCookies();
 
+    let clearDataSettings = document.getElementById("clearDataSettings");
+
     if (document.getElementById("historyMode").value == "custom") {
       let disabled = Preferences.get("browser.privatebrowsing.autostart").value;
       this.dependentControls.forEach(function(aElement) {
         let control = document.getElementById(aElement);
         let preferenceId = control.getAttribute("preference");
         if (!preferenceId) {
           let dependentControlId = control.getAttribute("control");
           if (dependentControlId) {
@@ -633,30 +635,34 @@ var gPrivacyPane = {
             preferenceId = dependentControl.getAttribute("preference");
           }
         }
 
         let preference = preferenceId ? Preferences.get(preferenceId) : {};
         control.disabled = disabled || preference.locked;
       });
 
+      clearDataSettings.removeAttribute("hidden");
+
       // adjust the checked state of the sanitizeOnShutdown checkbox
       document.getElementById("alwaysClear").checked = disabled ? false :
         Preferences.get("privacy.sanitize.sanitizeOnShutdown").value;
 
       // adjust the checked state of the remember history checkboxes
       document.getElementById("rememberHistory").checked = disabled ? false :
         Preferences.get("places.history.enabled").value;
       document.getElementById("rememberForms").checked = disabled ? false :
         Preferences.get("browser.formfill.enable").value;
 
       if (!disabled) {
         // adjust the Settings button for sanitizeOnShutdown
         this._updateSanitizeSettingsButton();
       }
+    } else {
+      clearDataSettings.setAttribute("hidden", "true");
     }
   },
 
   // CLEAR PRIVATE DATA
 
   /*
    * Preferences:
    *
--- a/browser/components/preferences/in-content/privacy.xul
+++ b/browser/components/preferences/in-content/privacy.xul
@@ -124,42 +124,42 @@
                       data-l10n-id="history-remember-search-option"
                       preference="browser.formfill.enable"/>
             <hbox id="clearDataBox"
                   align="center">
               <checkbox id="alwaysClear"
                         preference="privacy.sanitize.sanitizeOnShutdown"
                         data-l10n-id="history-clear-on-close-option"
                         flex="1" />
-              <!-- Please don't remove the wrapping hbox/vbox/box for these elements. It's used to properly compute the search tooltip position. -->
-              <hbox>
-                <button id="clearDataSettings"
-                        class="accessory-button"
-                        data-l10n-id="history-clear-on-close-settings"
-                        searchkeywords="&clearDataSettings3.label;
-                                        &historySection.label;
-                                        &itemHistoryAndDownloads.label;
-                                        &itemCookies.label;
-                                        &itemActiveLogins.label;
-                                        &itemCache.label;
-                                        &itemFormSearchHistory.label;
-                                        &dataSection.label;
-                                        &itemSitePreferences.label;
-                                        &itemOfflineApps.label;"/>
-              </hbox>
             </hbox>
           </vbox>
         </vbox>
       </vbox>
     </deck>
-    <vbox align="end">
+    <vbox id="historyButtons" align="end">
       <button id="clearHistoryButton"
               class="accessory-button"
               icon="clear"
               data-l10n-id="history-clear-button"/>
+      <!-- Please don't remove the wrapping hbox/vbox/box for these elements. It's used to properly compute the search tooltip position. -->
+      <hbox>
+        <button id="clearDataSettings"
+                class="accessory-button"
+                data-l10n-id="history-clear-on-close-settings"
+                searchkeywords="&clearDataSettings3.label;
+                                &historySection.label;
+                                &itemHistoryAndDownloads.label;
+                                &itemCookies.label;
+                                &itemActiveLogins.label;
+                                &itemCache.label;
+                                &itemFormSearchHistory.label;
+                                &dataSection.label;
+                                &itemSitePreferences.label;
+                                &itemOfflineApps.label;"/>
+      </hbox>
     </vbox>
   </hbox>
 </groupbox>
 
 <!-- Site Data -->
 <groupbox id="siteDataGroup" data-category="panePrivacy">
   <caption><label data-l10n-id="sitedata-header"/></caption>
 
--- a/browser/components/preferences/in-content/tests/browser_search_subdialogs_within_preferences_site_data.js
+++ b/browser/components/preferences/in-content/tests/browser_search_subdialogs_within_preferences_site_data.js
@@ -7,29 +7,29 @@ add_task(async function() {
   await SpecialPowers.pushPrefEnv({"set": [["browser.preferences.search", true]]});
 });
 
 /**
  * Test for searching for the "Settings - Site Data" subdialog.
  */
 add_task(async function() {
   await openPreferencesViaOpenPreferencesAPI("paneGeneral", {leaveOpen: true});
-  await evaluateSearchResults("cookies", ["siteDataGroup", "historyGroup"]);
+  await evaluateSearchResults("cookies", ["siteDataGroup"]);
   BrowserTestUtils.removeTab(gBrowser.selectedTab);
 });
 
 add_task(async function() {
   await openPreferencesViaOpenPreferencesAPI("paneGeneral", {leaveOpen: true});
-  await evaluateSearchResults("site data", ["siteDataGroup", "historyGroup"]);
+  await evaluateSearchResults("site data", ["siteDataGroup"]);
   BrowserTestUtils.removeTab(gBrowser.selectedTab);
 });
 
 add_task(async function() {
   await openPreferencesViaOpenPreferencesAPI("paneGeneral", {leaveOpen: true});
-  await evaluateSearchResults("cache", ["siteDataGroup", "historyGroup"]);
+  await evaluateSearchResults("cache", ["siteDataGroup"]);
   BrowserTestUtils.removeTab(gBrowser.selectedTab);
 });
 
 add_task(async function() {
   await openPreferencesViaOpenPreferencesAPI("paneGeneral", {leaveOpen: true});
   await evaluateSearchResults("third-party", "siteDataGroup");
   BrowserTestUtils.removeTab(gBrowser.selectedTab);
 });
--- a/browser/themes/shared/incontentprefs/preferences.inc.css
+++ b/browser/themes/shared/incontentprefs/preferences.inc.css
@@ -380,16 +380,22 @@ button > hbox > label {
 #trackingProtectionAdvancedSettings {
   margin-inline-start: 15px;
 }
 
 #historyPane {
   margin-top: 4px;
 }
 
+#historyButtons {
+  display: flex;
+  flex-direction: column;
+  justify-content: space-between;
+}
+
 #acceptCookies {
   margin-top: 1.5em;
 }
 
 /* Collapse the non-active vboxes in decks to use only the height the
    active vbox needs */
 #historyPane:not([selectedIndex="1"]) > #historyDontRememberPane,
 #historyPane:not([selectedIndex="2"]) > #historyCustomPane,