bug 479576 - Port Thunderbird Bug 449560 Accessibility: Give header email labels (From/To/CC) ARIA label properties in message reading window/pane, port by MarcoZ, r=IanN
authorLim Yuen Hoe <yuenhoe@hotmail.com>
Mon, 23 Feb 2009 07:45:21 +0100
changeset 2039 b65ce77398b05d69fc4e959056c7b81eb2e51668
parent 2038 720d3a1ea63d5782d098ee0fedcb7adff23f7f34
child 2040 3b7f1a26cde5bdd70fae9cb7260da6e75e9c5ad7
push id1651
push usermzehe@mozilla.com
push dateMon, 23 Feb 2009 11:58:49 +0000
treeherdercomm-central@b65ce77398b0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersIanN
bugs479576, 449560
bug 479576 - Port Thunderbird Bug 449560 Accessibility: Give header email labels (From/To/CC) ARIA label properties in message reading window/pane, port by MarcoZ, r=IanN
suite/mailnews/mailWidgets.xml
--- a/suite/mailnews/mailWidgets.xml
+++ b/suite/mailnews/mailWidgets.xml
@@ -270,16 +270,24 @@
             {
               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.
+            // Note: No extra colon and space needed, since it is
+            // already provided by this object's label attribute.
+            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);
@@ -460,17 +468,17 @@
         </body>
       </method>
     </implementation>
   </binding>
 
   <binding id="mail-emailaddress">
     <content popup="emailAddressPopup" context="emailAddressPopup">
       <xul:description anonid="emailValue" class="emailDisplayButton plain"
-                 xbl:inherits="xbl:text=label,crop" flex="1"/>
+                 xbl:inherits="xbl:text=label,crop,aria-label" flex="1"/>
       <xul:image class="emailDisplayImage" anonid="emailImage"
                  xbl:inherits="src=image"/>
     </content>
 
     <implementation>
       <property name="label"      onset="this.getPart('emailValue').setAttribute('label',val); return val;"
                                   onget="return this.getPart('emailValue').getAttribute('label');"/>
       <property name="crop"       onset="this.getPart('emailValue').setAttribute('crop',val); return val;"