Commit 0c43717c authored by Johann Hofmann's avatar Johann Hofmann
Browse files

Bug 1399478 - Fix buttonhighlight for doorhangers without a mainaction. r=steveck

We allow doorhangers to optionally disable the blue button
highlight for their main actions, but didn't account for the
fact that we display a default "OK" button when no mainAction
was provided.

MozReview-Commit-ID: 6ndWju3ytyq

--HG--
extra : rebase_source : 7ff7f85ed7cd538a1b499bf51e4cb11594a83a42
parent 6e7ba7a6
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -213,6 +213,8 @@ var tests = [
      this.notification = showNotification(this.notifyObj);
    },
    onShown(popup) {
      let notification = popup.childNodes[0];
      is(notification.getAttribute("buttonhighlight"), "true", "default action is highlighted");
      triggerMainCommand(popup);
    },
    onHidden(popup) {
@@ -233,6 +235,7 @@ var tests = [
    onShown(popup) {
      let notification = popup.childNodes[0];
      is(notification.getAttribute("secondarybuttonhidden"), "true", "secondary button is hidden");
      is(notification.getAttribute("buttonhighlight"), "true", "default action is highlighted");
      triggerMainCommand(popup);
    },
    onHidden(popup) {
+1 −0
Original line number Diff line number Diff line
@@ -787,6 +787,7 @@ PopupNotifications.prototype = {
      } else {
        // Enable the default button to let the user close the popup if the close button is hidden
        popupnotification.setAttribute("buttoncommand", "PopupNotifications._onButtonEvent(event, 'buttoncommand');");
        popupnotification.setAttribute("buttonhighlight", "true");
        popupnotification.removeAttribute("buttonlabel");
        popupnotification.removeAttribute("buttonaccesskey");
        popupnotification.removeAttribute("dropmarkerpopupshown");