Accessibility: Give header email labels (From/To/CC) ARIA label properties in message reading window/pane. - bug 449560 r=dmose
authorLim Yuen Hoe <yuenhoe@hotmail.com>
Fri, 20 Feb 2009 13:43:57 -0800
changeset 2009 96850ecdab8a9b1649e97a55eba2d5a356287889
parent 2008 45ab29f3575ff99a2cb72f93405f0ee6614ed068
child 2010 13801dfce5fe1525b2bbb475bfc57d141945195e
push id1627
push userdmosedale@mozilla.com
push dateFri, 20 Feb 2009 21:54:05 +0000
treeherdercomm-central@96850ecdab8a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdmose
bugs449560
Accessibility: Give header email labels (From/To/CC) ARIA label properties in message reading window/pane. - bug 449560 r=dmose
mail/base/content/mailWidgets.xml
--- a/mail/base/content/mailWidgets.xml
+++ b/mail/base/content/mailWidgets.xml
@@ -303,16 +303,22 @@
             {
               aEmailNode.setAttribute("label", aAddress.fullAddress || aAddress.displayName);
               aEmailNode.removeAttribute("tooltiptext");
             }
             aEmailNode.setAttribute("emailAddress", aAddress.emailAddress);
             aEmailNode.setAttribute("fullAddress", aAddress.fullAddress);
             aEmailNode.setAttribute("displayName", aAddress.displayName);
 
+            // Add aria-label with header field type and header field content
+            // for better accessibility
+            var ariaLabel = this.getAttribute("label") + ": " +
+                            aEmailNode.getAttribute("label");
+            aEmailNode.setAttribute("aria-label", ariaLabel);
+
             try
             {
               if ("AddExtraAddressProcessing" in top)
                 AddExtraAddressProcessing(aAddress.emailAddress, aEmailNode);
             }
             catch(ex)
             {
               dump("AddExtraAddressProcessing failed: " + ex + "\n");
@@ -484,17 +490,17 @@
         </body>
       </method>
     </implementation>
   </binding>
 
   <binding id="mail-emailaddress">
     <content>
       <xul:description anonid="emailValue" class="emailDisplayButton"
-                       xbl:inherits="hascard"
+                       xbl:inherits="hascard,aria-label"
                        context="emailAddressPopup" popup="emailAddressPopup"
                        flex="1">
         <xul:label class="emaillabel" anonid="emaillabel"
                    xbl:inherits="value=label,crop"/>
         <xul:image class="emailStar" anonid="emailStar"
                    context="emailAddressPopup"
                    onmousedown="event.preventDefault();"
                    onclick="onClickEmailStar(event, this.parentNode.parentNode);"