Bug 1353980 - Don't try to hide popup notifications in fullscreen mode. r=Paolo a=lizzard
authorJohann Hofmann <jhofmann@mozilla.com>
Fri, 07 Apr 2017 12:13:15 +0200
changeset 395778 e83b5cb99e4b25773ee5d47be960df59375afc4e
parent 395777 ecbabf4c7f8d4eac7d7f1e24bcd37387569c5573
child 395779 5daba4e7dc1236b435fb7510f401dbdcaa614045
push id1468
push userasasaki@mozilla.com
push dateMon, 05 Jun 2017 19:31:07 +0000
treeherdermozilla-release@0641fc6ee9d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersPaolo, lizzard
bugs1353980
milestone54.0a2
Bug 1353980 - Don't try to hide popup notifications in fullscreen mode. r=Paolo a=lizzard MozReview-Commit-ID: 5VWHooAIMRT
toolkit/modules/PopupNotifications.jsm
--- a/toolkit/modules/PopupNotifications.jsm
+++ b/toolkit/modules/PopupNotifications.jsm
@@ -254,16 +254,27 @@ this.PopupNotifications = function Popup
         activeElement == this.tabbrowser.selectedBrowser ||
         // Ignore focused elements inside the notification.
         getNotificationFromElement(activeElement) == notification ||
         notification.contains(activeElement)) {
       this._onButtonEvent(aEvent, "secondarybuttoncommand", notification);
     }
   };
 
+  // There are no anchor icons in DOM fullscreen mode, but we would
+  // still like to show the popup notification. To avoid an infinite
+  // loop of showing and hiding, we have to disable followanchor
+  // (which hides the element without an anchor) in fullscreen.
+  this.window.addEventListener("MozDOMFullscreen:Entered", () => {
+    this.panel.setAttribute("followanchor", "false");
+  }, true);
+  this.window.addEventListener("MozDOMFullscreen:Exited", () => {
+    this.panel.setAttribute("followanchor", "true");
+  }, true);
+
   this.window.addEventListener("activate", this, true);
   if (this.tabbrowser.tabContainer)
     this.tabbrowser.tabContainer.addEventListener("TabSelect", this, true);
 }
 
 PopupNotifications.prototype = {
 
   window: null,