Bug 1364516 - Move gCustomizeMode.setTab call out of updateTabLabelAndIcon. r=mikedeboer
☠☠ backed out by 3e02964068e9 ☠ ☠
authorDão Gottwald <dao@mozilla.com>
Fri, 12 May 2017 19:52:04 +0200
changeset 358462 b96483ca2c27a4da6a95ff752ee3b7a6ef7c8030
parent 358461 b8a70a04191172a20b26f42c07e4766ccd6cf898
child 358463 b900cd113877e7a9ab8c283d936f79b2d8209721
push id90339
push userkwierso@gmail.com
push dateMon, 15 May 2017 23:34:45 +0000
treeherdermozilla-inbound@30813e40f36c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmikedeboer
bugs1364516
milestone55.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 1364516 - Move gCustomizeMode.setTab call out of updateTabLabelAndIcon. r=mikedeboer While setTab does end up setting the label and icon, it also does completely different and more crucial things. This call really doesn't belong in updateTabLabelAndIcon. MozReview-Commit-ID: 9HXYS0fXgRN
browser/components/sessionstore/SessionStore.jsm
--- a/browser/components/sessionstore/SessionStore.jsm
+++ b/browser/components/sessionstore/SessionStore.jsm
@@ -2613,27 +2613,29 @@ var SessionStoreInternal = {
     }
 
     // Neither a tab nor a window was found, return undefined and let the caller decide what to do about it.
     return undefined;
   },
 
   /**
    * Updates the label and icon for a <xul:tab> using the data from
-   * tabData. If the tab being updated happens to be the
-   * customization mode tab, this function will tell the window's
-   * CustomizeMode instance about it.
+   * tabData.
    *
    * @param tab
    *        The <xul:tab> to update.
    * @param tabData (optional)
    *        The tabData to use to update the tab. If the argument is
    *        not supplied, the data will be retrieved from the cache.
    */
   updateTabLabelAndIcon(tab, tabData = null) {
+    if (tab.hasAttribute("customizemode")) {
+      return;
+    }
+
     let browser = tab.linkedBrowser;
     let win = browser.ownerGlobal;
 
     if (!tabData) {
       tabData = TabState.collect(tab);
       if (!tabData) {
         throw new Error("tabData not found for given tab");
       }
@@ -2643,18 +2645,16 @@ var SessionStoreInternal = {
 
     // If the page has a title, set it.
     if (activePageData) {
       if (activePageData.title) {
         win.gBrowser.setInitialTabTitle(tab, activePageData.title);
       } else if (activePageData.url != "about:blank") {
         win.gBrowser.setInitialTabTitle(tab, activePageData.url);
       }
-    } else if (tab.hasAttribute("customizemode")) {
-      win.gCustomizeMode.setTab(tab);
     }
 
     // Restore the tab icon.
     if ("image" in tabData) {
       // Use the serialized contentPrincipal with the new icon load.
       let loadingPrincipal = Utils.deserializePrincipal(tabData.iconLoadingPrincipal);
       win.gBrowser.setIcon(tab, tabData.image, loadingPrincipal);
       TabStateCache.update(browser, { image: null, iconLoadingPrincipal: null });
@@ -3687,16 +3687,20 @@ var SessionStoreInternal = {
       tab.__SS_lazyData = {
         url,
         title,
         userTypedValue: tabData.userTypedValue || "",
         userTypedClear: tabData.userTypedClear || 0
       };
     }
 
+    if (tab.hasAttribute("customizemode")) {
+      win.gCustomizeMode.setTab(tab);
+    }
+
     // Update tab label and icon to show something
     // while we wait for the messages to be processed.
     this.updateTabLabelAndIcon(tab, tabData);
 
     // Decrease the busy state counter after we're done.
     this._setWindowStateReady(window);
   },