Bug 934874 - Thunderbird: Header labels in message reader have last letter of aria-label truncated. r=mkmelin,a=Standard8 BETA_BASE_20140902
authorJames Teh <jamie@nvaccess.org>
Wed, 27 Aug 2014 11:50:22 +0100
changeset 20614 4a13f60a32c8ec3af6ebfaa8371f2b44b88577aa
parent 20613 737227f17593bcd4fab36adbc936bb0a488d1f41
child 20615 9ff336076866620ce26a61521c77c14e3c737b19
push id1209
push usermbanner@mozilla.com
push dateTue, 02 Sep 2014 16:59:36 +0000
treeherdercomm-beta@842e0fd167ee [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmkmelin, Standard8
bugs934874
Bug 934874 - Thunderbird: Header labels in message reader have last letter of aria-label truncated. r=mkmelin,a=Standard8
mail/base/content/mailWidgets.xml
mail/test/mozmill/message-header/test-message-header.js
--- a/mail/base/content/mailWidgets.xml
+++ b/mail/base/content/mailWidgets.xml
@@ -519,17 +519,17 @@
 
           // Since the control attribute points to the <mail-headerfield>
           // element rather than the XUL <textbox>, screen readers don't know to
           // automagically prepend the label when reading the textbox, so we
           // force this.  Furthermore, at least on Mac, there is no
           // JS labelElement property at all, so we skip this.  We get away
           // with it because there's no screen reader support on the Mac.
           if ("labelElement" in this) {
-            let ariaLabel = this.labelElement.value.slice(0,-1) + ": " + val;
+            let ariaLabel = this.labelElement.value + ": " + val;
             valueNode.setAttribute("aria-label", ariaLabel);
           }
 
           return valueNode.textContent = val;
           ]]>
         </setter>
       </property>
     </implementation>
@@ -608,17 +608,17 @@
             // Since the control attribute points to the
             // <mail-multi-emailHeaderField> element rather than the XUL
             // <mail-emailaddress>, screen readers don't know to automagically
             // prepend the label when reading the tag, so we force this.
             // Furthermore, at least on Mac, there is no JS labelElement
             // property at all, so we skip in that case.  We get away with it
             // because there's no screen reader support on the Mac.
             if ("labelElement" in this) {
-                let ariaLabel = this.labelElement.value.slice(0, -1) + ": " +
+                let ariaLabel = this.labelElement.value + ": " +
                                 aAddress.fullAddress || aAddress.displayName;
                 aEmailNode.setAttribute("aria-label", ariaLabel);
             }
 
             try
             {
               if ("UpdateEmailNodeDetails" in top)
                 UpdateEmailNodeDetails(aAddress.emailAddress, aEmailNode);
@@ -1072,17 +1072,17 @@
             // Since the control attribute points to the <newsgroups>
             // element rather than the XUL <label>, screen
             // readers don't know to automagically prepend the label when
             // reading the tag, so we force this.  Furthermore, at least on
             // Mac, there is no JS labelElement property at all, so we
             // skip in that case.  We get away with it because there's no
             // screen reader support on the Mac.
             if ("labelElement" in this) {
-                let ariaLabel = this.labelElement.value.slice(0, -1) + ": " +
+                let ariaLabel = this.labelElement.value + ": " +
                                 this.mNewsgroups[i];
                 let contentElement =
                   document.getAnonymousElementByAttribute(itemInDocument,
                                                           "anonid",
                                                           "newsgrouplabel");
                 contentElement.setAttribute("aria-label", ariaLabel);
             }
           }
@@ -1311,17 +1311,17 @@
               // Since the control attribute points to the
               // <mail-headerfield-tags> rather than the XUL <label>, screen
               // readers don't know to automagically prepend the label when
               // reading the tag, so we force this.  Furthermore, at least on
               // Mac, there is no JS labelElement property at all, so we
               // skip in that case.  We get away with it because there's no
               // screen reader support on the Mac.
               if ("labelElement" in this) {
-                let ariaLabel = this.labelElement.value.slice(0, -1) + ": "
+                let ariaLabel = this.labelElement.value + ": "
                                 + tagName;
                 label.setAttribute("aria-label", ariaLabel);
               }
 
               headerValueNode.appendChild(label);
             }
         ]]>
         </body>
--- a/mail/test/mozmill/message-header/test-message-header.js
+++ b/mail/test/mozmill/message-header/test-message-header.js
@@ -905,85 +905,85 @@ if ("nsIAccessibleRole" in Ci) {
    * @param expectedName code to be eval()ed returning the expected value of
    *                     nsIAccessible.name for the DOM element in question
    * @param expectedRole the expected value for nsIAccessible.role
    */
   let headersToTest = [
   {
     headerName: "Subject",
     headerValueElement: "mc.a('expandedsubjectBox', {class: 'headerValue'})",
-    expectedName: "mc.e('expandedsubjectLabel').value.slice(0,-1) + ': ' + " +
+    expectedName: "mc.e('expandedsubjectLabel').value + ': ' + " +
                   "headerValueElement.textContent",
     expectedRole: Ci.nsIAccessibleRole.ROLE_ENTRY
   },
   {
     headerName: "Content-Base",
     headerValueElement: "mc.a('expandedcontent-baseBox', {class: 'headerValue text-link headerValueUrl'})",
-    expectedName: "mc.e('expandedcontent-baseLabel').value.slice(0,-1) + ': ' + " +
+    expectedName: "mc.e('expandedcontent-baseLabel').value + ': ' + " +
                   "headerValueElement.textContent",
     expectedRole: Ci.nsIAccessibleRole.ROLE_ENTRY
   },
   {
     headerName: "From",
     headerValueElement: "mc.window.document.getAnonymousElementByAttribute(" +
                         "mc.a('expandedfromBox', {tagName: 'mail-emailaddress'})," +
                         "'class', 'emailDisplayButton')",
-    expectedName: "mc.e('expandedfromLabel').value.slice(0,-1) + ': ' + " +
+    expectedName: "mc.e('expandedfromLabel').value + ': ' + " +
                   "headerValueElement.parentNode.getAttribute('fullAddress')",
     expectedRole: Ci.nsIAccessibleRole.ROLE_ENTRY
   },
   {
     headerName: "To",
     headerValueElement: "mc.window.document.getAnonymousElementByAttribute(" +
                         "mc.a('expandedtoBox', {tagName: 'mail-emailaddress'})," +
                         "'class', 'emailDisplayButton')",
-    expectedName: "mc.e('expandedtoLabel').value.slice(0,-1) + ': ' + " +
+    expectedName: "mc.e('expandedtoLabel').value + ': ' + " +
                   "headerValueElement.parentNode.getAttribute('fullAddress')",
     expectedRole: Ci.nsIAccessibleRole.ROLE_ENTRY
   },
   {
     headerName: "Cc",
     headerValueElement: "mc.window.document.getAnonymousElementByAttribute(" +
                         "mc.a('expandedccBox', {tagName: 'mail-emailaddress'})," +
                         "'class', 'emailDisplayButton')",
-    expectedName: "mc.e('expandedccLabel').value.slice(0,-1) + ': ' + " +
+    expectedName: "mc.e('expandedccLabel').value + ': ' + " +
                   "headerValueElement.parentNode.getAttribute('fullAddress')",
     expectedRole: Ci.nsIAccessibleRole.ROLE_ENTRY
   },
   {
     headerName: "Bcc",
     headerValueElement: "mc.window.document.getAnonymousElementByAttribute(" +
                         "mc.a('expandedbccBox', {tagName: 'mail-emailaddress'})," +
                         "'class', 'emailDisplayButton')",
-    expectedName: "mc.e('expandedbccLabel').value.slice(0,-1) + ': ' + " +
+    expectedName: "mc.e('expandedbccLabel').value + ': ' + " +
                   "headerValueElement.parentNode.getAttribute('fullAddress')",
     expectedRole: Ci.nsIAccessibleRole.ROLE_ENTRY
   },
   {
     headerName: "Reply-To",
     headerValueElement: "mc.window.document.getAnonymousElementByAttribute(" +
                         "mc.a('expandedreply-toBox', {tagName: 'mail-emailaddress'})," +
                         "'class', 'emailDisplayButton')",
-    expectedName: "mc.e('expandedreply-toLabel').value.slice(0,-1) + ': ' + " +
+    expectedName: "mc.e('expandedreply-toLabel').value + ': ' + " +
                   "headerValueElement.parentNode.getAttribute('fullAddress')",
     expectedRole: Ci.nsIAccessibleRole.ROLE_ENTRY
   },
   {
     headerName: "Newsgroups",
     headerValueElement: "mc.window.document.getAnonymousElementByAttribute(" +
                         "mc.a('expandednewsgroupsBox', {tagName: 'mail-newsgroup'})," +
                         "'class', 'newsgrouplabel')",
-    expectedName: "mc.e('expandednewsgroupsLabel').value.slice(0,-1) + ': ' + " +
+    expectedName: "mc.e('expandednewsgroupsLabel').value + ': ' + " +
                   "headerValueElement.parentNode.parentNode.getAttribute('newsgroup')",
     expectedRole: Ci.nsIAccessibleRole.ROLE_ENTRY
   },
   {
     headerName: "Tags",
     headerValueElement: "mc.a('expandedtagsBox', {class: 'tagvalue blc-FF0000'})",
-    expectedName: "mc.e('expandedtagsLabel').value.slice(0,-1) + ': ' + " +
+    expectedName: "mc.e('expandedtagsLabel').value + ': ' + " +
                   "headerValueElement.getAttribute('value')",
     expectedRole: Ci.nsIAccessibleRole.ROLE_LABEL
   }
   ];
 
   // used to get the accessible object for a DOM node
   let gAccRetrieval = Cc["@mozilla.org/accessibleRetrieval;1"].
                       getService(Ci.nsIAccessibleRetrieval);