Only display permission prompts when they are anchored to the right icon (bug 1296252). r=johannh draft
authorPanos Astithas <past@mozilla.com>
Thu, 18 Aug 2016 11:22:07 +0000
changeset 428140 cdc09621a7100b9545d3f921cc2b089fa95623a3
parent 428139 4df9e92c0c933aea753434d63796853545d9a98e
child 428141 9b75c6785ac3e96bafd2539ed56de424e7a3bde5
push id33229
push userbmo:past@mozilla.com
push dateFri, 21 Oct 2016 16:15:16 +0000
reviewersjohannh
bugs1296252
milestone52.0a1
Only display permission prompts when they are anchored to the right icon (bug 1296252). r=johannh MozReview-Commit-ID: 93nzbZ8jnQK
toolkit/modules/PopupNotifications.jsm
--- a/toolkit/modules/PopupNotifications.jsm
+++ b/toolkit/modules/PopupNotifications.jsm
@@ -805,16 +805,20 @@ PopupNotifications.prototype = {
       this._setNotificationUIState(notificationEl, notification.options.checkbox.uncheckedState);
     }
   },
 
   _showPanel: function PopupNotifications_showPanel(notificationsToShow, anchorElement) {
     this.panel.hidden = false;
 
     notificationsToShow = notificationsToShow.filter(n => {
+      if (anchorElement != n.anchorElement) {
+        return false;
+      }
+
       let dismiss = this._fireCallback(n, NOTIFICATION_EVENT_SHOWING);
       if (dismiss)
         n.dismissed = true;
       return !dismiss;
     });
     if (!notificationsToShow.length)
       return;
     let notificationIds = notificationsToShow.map(n => n.id);