Backed out changeset c8a4f2586fc0 (bug 1291427) for devtools on browser_storage_cookies_edit.js on a CLOSED TREE
authorOana Pop Rus <opoprus@mozilla.com>
Fri, 08 Mar 2019 17:48:49 +0200
changeset 521052 d3d719ba069153ae29a99f60ec537133345c7ff0
parent 521051 def4c84342462fb2b23a7a3940f7cfcad919dcd6
child 521053 7520d595404d3be1a0649f745d738f0a4d0c0521
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1291427
milestone67.0a1
backs outc8a4f2586fc01b1e13303f55eaa096c306674416
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
Backed out changeset c8a4f2586fc0 (bug 1291427) for devtools on browser_storage_cookies_edit.js on a CLOSED TREE
devtools/client/storage/ui.js
--- a/devtools/client/storage/ui.js
+++ b/devtools/client/storage/ui.js
@@ -75,16 +75,17 @@ const ITEM_NAME_MAX_LENGTH = 32;
  * @param {Target} target
  *        Interface for the page we're debugging
  * @param {Window} panelWin
  *        Window of the toolbox panel to populate UI in.
  */
 class StorageUI {
   constructor(front, target, panelWin, toolbox) {
     EventEmitter.decorate(this);
+
     this._target = target;
     this._window = panelWin;
     this._panelDoc = panelWin.document;
     this._toolbox = toolbox;
     this.front = front;
     this.storageTypes = null;
     this.sidebarToggledOpen = null;
     this.shouldLoadMoreItems = true;
@@ -624,18 +625,16 @@ class StorageUI {
           await this._target.actorHasMethod(type, "removeAllSessionCookies");
 
         await this.resetColumns(type, host, subType);
       }
 
       const {data} = await storageType.getStoreObjects(host, names, fetchOpts);
       if (data.length) {
         await this.populateTable(data, reason);
-      } else {
-        await this.clearHeaders();
       }
       this.updateToolbar();
       this.emit("store-objects-updated");
     } catch (ex) {
       console.error(ex);
     }
   }
 
@@ -649,18 +648,17 @@ class StorageUI {
     // The first node is just a title e.g. "Cookies" so we need to be at least
     // 2 nodes in to show the add button.
     const canAdd = this.actorSupportsAddItem && howManyNodesIn > 1;
 
     if (canAdd) {
       this._addButton.hidden = false;
       this._addButton.setAttribute("tooltiptext",
         L10N.getFormatStr("storage.popupMenu.addItemLabel"));
-    }
-    if (!canAdd || this.table.columns.size < 1) {
+    } else {
       this._addButton.hidden = true;
       this._addButton.removeAttribute("tooltiptext");
     }
   }
 
   /**
    * Populates the storage tree which displays the list of storages present for
    * the page.
@@ -982,35 +980,26 @@ class StorageUI {
     const [type, host] = item;
     this.table.host = host;
     this.table.datatype = type;
 
     this.updateToolbar();
 
     let names = null;
     if (!host) {
-      // If selected item has no host then reset table headers :Bug 1291427
-      await this.clearHeaders();
       return;
     }
     if (item.length > 2) {
       names = [JSON.stringify(item.slice(2))];
     }
     await this.fetchStorageObjects(type, host, names, REASON.POPULATE);
     this.itemOffset = 0;
   }
 
   /**
-   * Clear the column headers in the storage table
-   */
-  async clearHeaders() {
-    this.table.setColumns({}, null, {}, {});
-  }
-
-  /**
    * Resets the column headers in the storage table with the pased object `data`
    *
    * @param {string} type
    *        The type of storage corresponding to the after-reset columns in the
    *        table.
    * @param {string} host
    *        The host name corresponding to the table after reset.
    *