Bug 1559127 - Fix aria-label for back buttons in the appmenu. r=darktrojan a=jorgk BETA_68_CONTINUATION
authorPaul Morris <paul@paulwmorris.com>
Wed, 10 Jul 2019 07:29:20 +0200
branchBETA_68_CONTINUATION
changeset 36070 feabcfb77b987338e3a28a8b7d6440ff9e0e2e23
parent 36069 45da8935d5bea2df0383a744904028588819dc51
child 36071 658bff9d5cc55ec3bc9c0c4280127d78773ee064
push id392
push userclokep@gmail.com
push dateMon, 02 Sep 2019 20:17:19 +0000
reviewersdarktrojan, jorgk
bugs1559127
Bug 1559127 - Fix aria-label for back buttons in the appmenu. r=darktrojan a=jorgk
mail/components/customizableui/PanelMultiView.jsm
mail/components/customizableui/content/panelUI.inc.xul
--- a/mail/components/customizableui/PanelMultiView.jsm
+++ b/mail/components/customizableui/PanelMultiView.jsm
@@ -99,29 +99,21 @@
 
 "use strict";
 
 var EXPORTED_SYMBOLS = [
   "PanelMultiView",
   "PanelView",
 ];
 
-// TODO appmenu - Usage is commented out below.  Keep eslint happy.
-// const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 ChromeUtils.defineModuleGetter(this, "CustomizableUI",
   "resource:///modules/CustomizableUI.jsm");
 
-// TODO appmenu - Needs updating for Thunderbird. Usage is commented out below.
-// XPCOMUtils.defineLazyGetter(this, "gBundle", function() {
-//   return Services.strings.createBundle(
-//     "chrome://browser/locale/browser.properties");
-// });
-
 /**
  * Safety timeout after which asynchronous events will be canceled if any of the
  * registered blockers does not return.
  */
 const BLOCKERS_TIMEOUT_MS = 10000;
 
 const TRANSITION_PHASES = Object.freeze({
   START: 1,
@@ -1277,20 +1269,20 @@ var PanelView = class extends Associated
     header.classList.add("panel-header");
 
     let backButton = this.document.createXULElement("toolbarbutton");
     backButton.className =
       "subviewbutton subviewbutton-iconic subviewbutton-back";
     backButton.setAttribute("closemenu", "none");
     backButton.setAttribute("tabindex", "0");
 
-    // TODO appmenu gBundle.GetStringFromName is undefined call
-    // Possible string addition/change.
-    // backButton.setAttribute("aria-label",
-    //   gBundle.GetStringFromName("panel.back"));
+    // Using "backButtonLabel" is a temporary workaround. See bug 1559127.
+    backButton.setAttribute("aria-label",
+      this.document.getElementById("appMenu-popup")
+      .getAttribute("backButtonLabel"));
 
     backButton.addEventListener("command", () => {
       // The panelmultiview element may change if the view is reused.
       this.node.panelMultiView.goBack();
       backButton.blur();
     });
 
     let label = this.document.createXULElement("label");
--- a/mail/components/customizableui/content/panelUI.inc.xul
+++ b/mail/components/customizableui/content/panelUI.inc.xul
@@ -117,23 +117,25 @@
     <popupnotificationcontent class="addon-private-browsing-notification-content" orient="vertical">
       <description id="addon-private-browsing-description" data-lazy-l10n-id="appmenu-addon-private-browsing-message"></description>
       <label id="addon-private-browsing-learn-more"
              class="text-link" is="text-link" data-lazy-l10n-id="appmenu-addon-private-browsing-learn-more"></label>
     </popupnotificationcontent>
   </popupnotification>
 </panel>
 
+<!-- The backButtonLabel attribute is a temporary workaround for accessing that string. See bug 1559127. -->
 <panel id="appMenu-popup"
        class="cui-widget-panel"
        role="group"
        type="arrow"
        hidden="true"
        flip="slide"
        position="bottomcenter topright"
+       backButtonLabel="&backButton1.label;"
        noautofocus="true">
   <panelmultiview id="appMenu-multiView"
                   mainViewId="appMenu-mainView"
                   viewCacheId="appMenu-viewCache">
 
     <!-- Main Appmenu View -->
     <panelview id="appMenu-mainView" class="PanelUI-subView"
                descriptionheightworkaround="true">