Bug 1194503 - make appendNotification not set accesskey="undefined" if passed a structure with no accesskey, r=gijs
authorYFdyh000 <yfdyh000@gmail.com>
Thu, 13 Aug 2015 21:38:00 +0100
changeset 285180 bd5b01dfe7d79cc45e0f41e5edcf08b91444e714
parent 285179 66d1159b02a6bdf908b8818b2bbc800c258626b9
child 285181 9fc432621b17fe4853323927d211b6928497ae97
child 285260 beb9cc29efb9f727d22f179bcf551ca0bcb842ef
push id4397
push usergijskruitbosch@gmail.com
push dateFri, 14 Aug 2015 13:43:25 +0000
reviewersgijs
bugs1194503
milestone43.0a1
Bug 1194503 - make appendNotification not set accesskey="undefined" if passed a structure with no accesskey, r=gijs
toolkit/content/widgets/notification.xml
--- a/toolkit/content/widgets/notification.xml
+++ b/toolkit/content/widgets/notification.xml
@@ -117,17 +117,18 @@
               // added to the first button (unless that button has isDefault
               // set to false). There cannot be multiple default buttons.
               var defaultElem;
 
               for (var b = 0; b < aButtons.length; b++) {
                 var button = aButtons[b];
                 var buttonElem = document.createElementNS(XULNS, "button");
                 buttonElem.setAttribute("label", button.label);
-                buttonElem.setAttribute("accesskey", button.accessKey);
+                if (typeof button.accessKey == "string")
+                  buttonElem.setAttribute("accesskey", button.accessKey);
                 if (typeof button.type == "string") {
                   buttonElem.setAttribute("type", button.type);
                   if ((button.type == "menu-button" || button.type == "menu") &&
                       "popup" in button) {
                     buttonElem.appendChild(button.popup);
                     delete button.popup;
                   }
                   if (typeof button.anchor == "string")