Bug 1353980 - Don't try to hide popup notifications in fullscreen mode. r=Paolo draft
authorJohann Hofmann <jhofmann@mozilla.com>
Fri, 07 Apr 2017 12:13:15 +0200
changeset 558256 68edd613749004836dfecc0cc7e857ec6e3d69ae
parent 557282 facaf90aeaaf6d7cf5e2966f9f918319536bddea
child 623179 ab2dc3f0ddb51e64ceb5c0d9927b52ec19970004
push id52854
push userbmo:jhofmann@mozilla.com
push dateFri, 07 Apr 2017 13:15:34 +0000
reviewersPaolo
bugs1353980
milestone55.0a1
Bug 1353980 - Don't try to hide popup notifications in fullscreen mode. r=Paolo 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,