Bug 1547326 - Convert storage inspector buttons to html:button in order to drop support for <xul:button class="devtools-button"> r=jdescottes
authorBrian Grinstead <bgrinstead@mozilla.com>
Fri, 26 Apr 2019 20:19:55 +0000
changeset 530404 f41ea9d40a05327739aa20813430b45c2ef63785
parent 530403 0b745e9ecd500577d9da5049ea21980a5f0659d6
child 530405 776c731d7c71a3a9845671c624c8335d5533dc81
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdescottes
bugs1547326
milestone68.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 1547326 - Convert storage inspector buttons to html:button in order to drop support for <xul:button class="devtools-button"> r=jdescottes Differential Revision: https://phabricator.services.mozilla.com/D29035
devtools/client/storage/index.xul
devtools/client/storage/ui.js
--- a/devtools/client/storage/index.xul
+++ b/devtools/client/storage/index.xul
@@ -8,17 +8,18 @@
 <?xml-stylesheet href="chrome://devtools/skin/storage.css" type="text/css"?>
 <?xml-stylesheet href="resource://devtools/client/shared/components/SidebarToggle.css" type="text/css"?>
 
 <!DOCTYPE window [
   <!ENTITY % storageDTD SYSTEM "chrome://devtools/locale/storage.dtd">
   %storageDTD;
 ]>
 
-<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+	      xmlns:html="http://www.w3.org/1999/xhtml">
 
   <script src="chrome://devtools/content/shared/theme-switching.js"/>
   <script src="chrome://global/content/globalOverlay.js"/>
   <script src="chrome://global/content/editMenuOverlay.js"/>
 
   <popupset id="storagePopupSet">
     <menupopup id="storage-tree-popup">
       <menuitem id="storage-tree-popup-delete-all"
@@ -42,25 +43,25 @@
     </menupopup>
   </popupset>
 
   <box flex="1" class="devtools-responsive-container theme-body">
     <vbox id="storage-tree"/>
     <splitter class="devtools-side-splitter"/>
     <vbox flex="1">
       <hbox id="storage-toolbar" class="devtools-toolbar">
-        <button id="add-button"
-                class="devtools-button add-button"></button>
-        <button id="refresh-button"
-                class="devtools-button refresh-button"></button>
+        <html:button id="add-button"
+                class="devtools-button add-button"></html:button>
+        <html:button id="refresh-button"
+                class="devtools-button refresh-button"></html:button>
         <spacer flex="1"/>
         <textbox id="storage-searchbox"
                  class="devtools-filterinput"
                  placeholder="&searchBox.placeholder;"/>
-        <button class="devtools-button sidebar-toggle" hidden="true"></button>
+        <html:button class="devtools-button sidebar-toggle" hidden="true"></html:button>
       </hbox>
       <vbox id="storage-table" class="theme-sidebar" flex="1"/>
     </vbox>
     <splitter class="devtools-side-splitter"/>
     <vbox id="storage-sidebar" class="devtools-sidebar-tabs" hidden="true">
       <vbox flex="1"/>
     </vbox>
   </box>
--- a/devtools/client/storage/ui.js
+++ b/devtools/client/storage/ui.js
@@ -191,22 +191,22 @@ class StorageUI {
     this.onCopyItem = this.onCopyItem.bind(this);
     this.onRemoveItem = this.onRemoveItem.bind(this);
     this.onRemoveAllFrom = this.onRemoveAllFrom.bind(this);
     this.onRemoveAll = this.onRemoveAll.bind(this);
     this.onRemoveAllSessionCookies = this.onRemoveAllSessionCookies.bind(this);
     this.onRemoveTreeItem = this.onRemoveTreeItem.bind(this);
 
     this._refreshButton = this._panelDoc.getElementById("refresh-button");
-    this._refreshButton.addEventListener("command", this.onRefreshTable);
-    this._refreshButton.setAttribute("tooltiptext",
+    this._refreshButton.addEventListener("click", this.onRefreshTable);
+    this._refreshButton.setAttribute("title",
     L10N.getFormatStr("storage.popupMenu.refreshItemLabel"));
 
     this._addButton = this._panelDoc.getElementById("add-button");
-    this._addButton.addEventListener("command", this.onAddItem);
+    this._addButton.addEventListener("click", this.onAddItem);
 
     this._variableViewPopupCopy = this._panelDoc.getElementById(
       "variable-view-popup-copy");
     this._variableViewPopupCopy.addEventListener("command", this.onCopyItem);
 
     this._tablePopupAddItem = this._panelDoc.getElementById(
       "storage-table-popup-add");
     this._tablePopupAddItem.addEventListener("command", this.onAddItem);
@@ -257,18 +257,18 @@ class StorageUI {
     this._panelDoc.removeEventListener("keypress", this.handleKeypress);
     this.searchBox.removeEventListener("input", this.filterItems);
     this.searchBox = null;
 
     this.sidebarToggleBtn.removeEventListener("click", this.onPaneToggleButtonClicked);
     this.sidebarToggleBtn = null;
 
     this._treePopup.removeEventListener("popupshowing", this.onTreePopupShowing);
-    this._refreshButton.removeEventListener("command", this.onRefreshTable);
-    this._addButton.removeEventListener("command", this.onAddItem);
+    this._refreshButton.removeEventListener("click", this.onRefreshTable);
+    this._addButton.removeEventListener("click", this.onAddItem);
     this._tablePopupAddItem.removeEventListener("command", this.onAddItem);
     this._treePopupDeleteAll.removeEventListener("command", this.onRemoveAll);
     this._treePopupDeleteAllSessionCookies.removeEventListener("command",
       this.onRemoveAllSessionCookies);
     this._treePopupDelete.removeEventListener("command", this.onRemoveTreeItem);
 
     this._tablePopup.removeEventListener("popupshowing", this.onTablePopupShowing);
     this._tablePopupDelete.removeEventListener("command", this.onRemoveItem);
@@ -307,17 +307,17 @@ class StorageUI {
     if (this.sidebar.hidden) {
       this.sidebarToggleBtn.classList.add("pane-collapsed");
       title = L10N.getStr("storage.expandPane");
     } else {
       this.sidebarToggleBtn.classList.remove("pane-collapsed");
       title = L10N.getStr("storage.collapsePane");
     }
 
-    this.sidebarToggleBtn.setAttribute("tooltiptext", title);
+    this.sidebarToggleBtn.setAttribute("title", title);
   }
 
   /**
    * Hide the object viewer sidebar
    */
   hideSidebar() {
     this.sidebar.hidden = true;
     this.updateSidebarToggleButton();
@@ -658,17 +658,17 @@ class StorageUI {
     const howManyNodesIn = item ? item.length : 0;
 
     // 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",
+      this._addButton.setAttribute("title",
         L10N.getFormatStr("storage.popupMenu.addItemLabel"));
     }
   }
 
   /**
    * Populates the storage tree which displays the list of storages present for
    * the page.
    *