Bug 1430128 - Remove remnants of the iconsize attribute. r=Gijs
authorDão Gottwald <dao@mozilla.com>
Fri, 12 Jan 2018 16:03:44 +0100
changeset 453293 186c8d28a01b57bfb8d1af2cd47029290802180c
parent 453292 a3e930a4edfd0a1913cfa7d41ee59a0e0aa79ea8
child 453294 eb8b800a2c8b0d221b6a22a236b4ec5c6c82fcdf
push id1648
push usermtabara@mozilla.com
push dateThu, 01 Mar 2018 12:45:47 +0000
treeherdermozilla-release@cbb9688c2eeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs
bugs1430128
milestone59.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 1430128 - Remove remnants of the iconsize attribute. r=Gijs MozReview-Commit-ID: 3a80XcR3NUM
browser/base/content/browser.xul
browser/components/customizableui/content/toolbar.xml
browser/components/nsBrowserGlue.js
toolkit/themes/osx/global/toolbar.css
--- a/browser/base/content/browser.xul
+++ b/browser/base/content/browser.xul
@@ -597,17 +597,17 @@
 #endif
 
 <deck flex="1" id="tab-view-deck">
 <vbox flex="1" id="browser-panel">
 
   <toolbox id="navigator-toolbox">
     <!-- Menu -->
     <toolbar type="menubar" id="toolbar-menubar" class="chromeclass-menubar" customizable="true"
-             mode="icons" iconsize="small"
+             mode="icons"
 #ifdef MENUBAR_CAN_AUTOHIDE
              toolbarname="&menubarCmd.label;"
              accesskey="&menubarCmd.accesskey;"
              autohide="true"
 #endif
              context="toolbar-context-menu">
       <toolbaritem id="menubar-items" align="center">
 # The entire main menubar is placed into browser-menubar.inc, so that it can be shared by
@@ -623,17 +623,16 @@
 #endif
 #endif
     </toolbar>
 
     <toolbar id="TabsToolbar"
              fullscreentoolbar="true"
              customizable="true"
              mode="icons"
-             iconsize="small"
              aria-label="&tabsToolbar.label;"
              context="toolbar-context-menu"
              collapsed="true">
 
 #ifdef CAN_DRAW_IN_TITLEBAR
       <hbox class="titlebar-placeholder" type="pre-tabs"
             skipintoolbarset="true"/>
 #endif
@@ -706,17 +705,16 @@
             skipintoolbarset="true"/>
 #endif
 #endif
     </toolbar>
 
     <toolbar id="nav-bar"
              aria-label="&navbarCmd.label;"
              fullscreentoolbar="true" mode="icons" customizable="true"
-             iconsize="small"
              customizationtarget="nav-bar-customization-target"
              overflowable="true"
              overflowbutton="nav-bar-overflow-button"
              overflowtarget="widget-overflow-list"
              overflowpanel="widget-overflow"
              context="toolbar-context-menu">
 
       <hbox id="nav-bar-customization-target" flex="1">
@@ -974,17 +972,17 @@
 
         <toolbarbutton id="close-button"
                        tooltiptext="&fullScreenClose.tooltip;"
                        oncommand="BrowserTryToCloseWindow();"/>
       </hbox>
     </toolbar>
 
     <toolbar id="PersonalToolbar"
-             mode="icons" iconsize="small"
+             mode="icons"
              class="chromeclass-directories"
              context="toolbar-context-menu"
              toolbarname="&personalbarCmd.label;" accesskey="&personalbarCmd.accesskey;"
              collapsed="true"
              customizable="true">
       <toolbaritem id="personal-bookmarks"
                    title="&bookmarksToolbarItem.label;"
                    cui-areatype="toolbar"
--- a/browser/components/customizableui/content/toolbar.xml
+++ b/browser/components/customizableui/content/toolbar.xml
@@ -21,35 +21,16 @@
           let CustomizableUI = scope.CustomizableUI;
           // Add an early overflow event listener that will mark if the
           // toolbar overflowed during construction.
           if (CustomizableUI.isAreaOverflowable(this.id)) {
             this.addEventListener("overflow", this);
             this.addEventListener("underflow", this);
           }
 
-          // Bug 989289: Forcibly set the now unsupported "mode" and "iconsize"
-          // attributes, just in case they accidentally get restored from
-          // persistence from a user that's been upgrading and downgrading.
-          if (CustomizableUI.isBuiltinToolbar(this.id)) {
-            const kAttributes = new Map([["mode", "icons"], ["iconsize", "small"]]);
-            for (let [attribute, value] of kAttributes) {
-              if (this.getAttribute(attribute) != value) {
-                this.setAttribute(attribute, value);
-                document.persist(this.id, attribute);
-              }
-              if (this.toolbox) {
-                if (this.toolbox.getAttribute(attribute) != value) {
-                  this.toolbox.setAttribute(attribute, value);
-                  document.persist(this.toolbox.id, attribute);
-                }
-              }
-            }
-          }
-
           // Searching for the toolbox palette in the toolbar binding because
           // toolbars are constructed first.
           let toolbox = this.toolbox;
           if (toolbox && !toolbox.palette) {
             for (let node of toolbox.children) {
               if (node.localName == "toolbarpalette") {
                 // Hold on to the palette but remove it from the document.
                 toolbox.palette = node;
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -1769,17 +1769,17 @@ BrowserGlue.prototype = {
       if (toolbarIsCustomized || getToolbarFolderCount() > NUM_TOOLBAR_BOOKMARKS_TO_UNHIDE) {
         xulStore.setValue(BROWSER_DOCURL, "PersonalToolbar", "collapsed", "false");
       }
     }
   },
 
   // eslint-disable-next-line complexity
   _migrateUI: function BG__migrateUI() {
-    const UI_VERSION = 61;
+    const UI_VERSION = 62;
     const BROWSER_DOCURL = "chrome://browser/content/browser.xul";
 
     let currentUIVersion;
     if (Services.prefs.prefHasUserValue("browser.migration.version")) {
       currentUIVersion = Services.prefs.getIntPref("browser.migration.version");
     } else {
       // This is a new profile, nothing to migrate.
       Services.prefs.setIntPref("browser.migration.version", UI_VERSION);
@@ -1834,27 +1834,16 @@ BrowserGlue.prototype = {
             currentset = currentset.replace(/(^|,)window-controls($|,)/,
                                             "$1bookmarks-menu-button,window-controls$2");
           }
           xulStore.setValue(BROWSER_DOCURL, "nav-bar", "currentset", currentset);
         }
       }
     }
 
-    if (currentUIVersion < 18) {
-      // Remove iconsize and mode from all the toolbars
-      let toolbars = ["navigator-toolbox", "nav-bar", "PersonalToolbar",
-                      "TabsToolbar", "toolbar-menubar"];
-      for (let resourceName of ["mode", "iconsize"]) {
-        for (let toolbarId of toolbars) {
-          xulStore.removeValue(BROWSER_DOCURL, toolbarId, resourceName);
-        }
-      }
-    }
-
     if (currentUIVersion < 19) {
       let detector = null;
       try {
         detector = Services.prefs.getComplexValue("intl.charset.detector",
                                                   Ci.nsIPrefLocalizedString).data;
       } catch (ex) {}
       if (!(detector == "" ||
             detector == "ja_parallel_state_machine" ||
@@ -2265,16 +2254,27 @@ BrowserGlue.prototype = {
       this._migrateMatchBucketsPrefForUIVersion60();
     }
 
     if (currentUIVersion < 61) {
       // Remove persisted toolbarset from navigator toolbox
       xulStore.removeValue(BROWSER_DOCURL, "navigator-toolbox", "toolbarset");
     }
 
+    if (currentUIVersion < 62) {
+      // Remove iconsize and mode from all the toolbars
+      let toolbars = ["navigator-toolbox", "nav-bar", "PersonalToolbar",
+                      "TabsToolbar", "toolbar-menubar"];
+      for (let resourceName of ["mode", "iconsize"]) {
+        for (let toolbarId of toolbars) {
+          xulStore.removeValue(BROWSER_DOCURL, toolbarId, resourceName);
+        }
+      }
+    }
+
     // Update the migration version.
     Services.prefs.setIntPref("browser.migration.version", UI_VERSION);
   },
 
   _checkForDefaultBrowser() {
     // Perform default browser checking.
     if (!ShellService) {
       return;
--- a/toolkit/themes/osx/global/toolbar.css
+++ b/toolkit/themes/osx/global/toolbar.css
@@ -37,24 +37,21 @@ toolbarseparator {
 }
 
 /* ::::: toolbarpaletteitem ::::: */
 
 toolbarpaletteitem {
   cursor: grab;
 }
 
-toolbar[iconsize="small"] toolbarpaletteitem[type="spacer"] {
+toolbarpaletteitem[type="spacer"],
+toolbarspacer {
   min-width: 24px !important;
 }
 
-toolbarpaletteitem[type="spacer"] {
-  min-width: 32px !important;
-}
-
 .toolbarpaletteitem-box[type="spacer"] {
   border: 1px solid #A3A3A3;
   background: url("chrome://global/skin/10pct_transparent_grey.png") repeat;
   width: 32px;
   margin-top: 18px;
 }
 
 .toolbarpaletteitem-box[type="spring"] {
@@ -103,16 +100,8 @@ toolbarpaletteitem[place="toolbar"] {
 toolbarpaletteitem[dragover="left"] {
   border-left-color: #000000;
 }
 
 toolbarpaletteitem[dragover="right"] {
   border-right-color: #000000;
 }
 
-toolbar[iconsize="small"] toolbarspacer {
-  min-width: 24px !important;
-}
-
-toolbarspacer {
-  min-width: 32px !important;
-}
-