Bug 1296252 - Part 1 - Only display doorhanger notifications when they are anchored to the right icon. r=johannh draft
authorPanos Astithas <past@mozilla.com>
Sun, 20 Nov 2016 18:40:12 +0100
changeset 441671 1364cfbaa6bcb176142ec2955085e121af528cb3
parent 441670 e4bf954ffdf3a5df6b7b88f1f6cdc2697dddfb18
child 441672 e09f6229e47481fbd3040932f82e08a48b85ca70
push id36488
push userpaolo.mozmail@amadzone.org
push dateSun, 20 Nov 2016 17:47:21 +0000
reviewersjohannh
bugs1296252
milestone53.0a1
Bug 1296252 - Part 1 - Only display doorhanger notifications when they are anchored to the right icon. r=johannh MozReview-Commit-ID: 93nzbZ8jnQK
toolkit/modules/PopupNotifications.jsm
--- a/toolkit/modules/PopupNotifications.jsm
+++ b/toolkit/modules/PopupNotifications.jsm
@@ -812,16 +812,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);