Bug 1506112 - Replace customize-context-autoHide class with meaningful id. r=Gijs
authorDão Gottwald <dao@mozilla.com>
Fri, 09 Nov 2018 16:23:52 +0000
changeset 501876 55f917d4f4834353522521fc6b748eab64c4d15d
parent 501875 1f67ea0716dd72cbe7321c6a003a10261683a288
child 501877 393308a8a29c848b93ecc1c5c1cd5970b26bded6
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs
bugs1506112
milestone65.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 1506112 - Replace customize-context-autoHide class with meaningful id. r=Gijs Differential Revision: https://phabricator.services.mozilla.com/D11469
browser/base/content/browser.js
browser/base/content/browser.xul
browser/components/downloads/test/browser/browser_downloads_autohide.js
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -6294,17 +6294,17 @@ function UpdateCurrentCharset(target) {
   for (let menuItem of target.getElementsByTagName("menuitem")) {
     let isSelected = menuItem.getAttribute("charset") === selectedCharset;
     menuItem.setAttribute("checked", isSelected);
   }
 }
 
 var ToolbarContextMenu = {
   updateDownloadsAutoHide(popup) {
-    let checkbox = popup.querySelector(".customize-context-autoHide");
+    let checkbox = document.getElementById("toolbar-context-autohide-downloads-button");
     let isDownloads = popup.triggerNode && ["downloads-button", "wrapper-downloads-button"].includes(popup.triggerNode.id);
     checkbox.hidden = !isDownloads;
     if (DownloadsButton.autoHideDownloadsButton) {
       checkbox.setAttribute("checked", "true");
     } else {
       checkbox.removeAttribute("checked");
     }
   },
--- a/browser/base/content/browser.xul
+++ b/browser/base/content/browser.xul
@@ -427,22 +427,22 @@ xmlns="http://www.w3.org/1999/xhtml"
                 contexttype="toolbaritem"
                 class="customize-context-removeExtension"/>
       <menuseparator/>
       <menuitem oncommand="gCustomizeMode.addToPanel(document.popupNode)"
                 accesskey="&customizeMenu.pinToOverflowMenu.accesskey;"
                 label="&customizeMenu.pinToOverflowMenu.label;"
                 contexttype="toolbaritem"
                 class="customize-context-moveToPanel"/>
-      <menuitem oncommand="ToolbarContextMenu.onDownloadsAutoHideChange(event)"
+      <menuitem id="toolbar-context-autohide-downloads-button"
+                oncommand="ToolbarContextMenu.onDownloadsAutoHideChange(event);"
                 type="checkbox"
                 accesskey="&customizeMenu.autoHideDownloadsButton.accesskey;"
                 label="&customizeMenu.autoHideDownloadsButton.label;"
-                contexttype="toolbaritem"
-                class="customize-context-autoHide"/>
+                contexttype="toolbaritem"/>
       <menuitem oncommand="gCustomizeMode.removeFromArea(document.popupNode)"
                 accesskey="&customizeMenu.removeFromToolbar.accesskey;"
                 label="&customizeMenu.removeFromToolbar.label;"
                 contexttype="toolbaritem"
                 class="customize-context-removeFromToolbar"/>
       <menuitem id="toolbar-context-reloadSelectedTab"
                 class="toolbaritem-tabsmenu"
                 contexttype="tabbar"
--- a/browser/components/downloads/test/browser/browser_downloads_autohide.js
+++ b/browser/components/downloads/test/browser/browser_downloads_autohide.js
@@ -285,17 +285,17 @@ add_task(async function checkStateWhenHi
     // tests check this).
   }
   await BrowserTestUtils.closeWindow(otherWin);
   CustomizableUI.reset();
 });
 
 add_task(async function checkContextMenu() {
   let contextMenu = document.getElementById("toolbar-context-menu");
-  let checkbox = contextMenu.querySelector(".customize-context-autoHide");
+  let checkbox = document.getElementById("toolbar-context-autohide-downloads-button");
   let button = document.getElementById("downloads-button");
 
   is(Services.prefs.getBoolPref(kDownloadAutoHidePref), true,
      "Pref should be causing us to autohide");
   is(DownloadsIndicatorView.hasDownloads, false,
      "Should be no downloads when starting the test");
   is(button.hidden, true, "Downloads button is hidden");