Bug 1320314 - Move popup notification layout overrides for arrow panels into a shared file. r=dao draft
authorJohann Hofmann <jhofmann@mozilla.com>
Fri, 25 Nov 2016 19:31:27 +0000
changeset 456896 883a2f71e658e6dfbf26993da44f3cefc0286d57
parent 456716 a14094edbad78fc1d16e8d4c57902537cf286fd1
child 541353 d650271ff37868e8e8ed80cd4640d216d68b8df2
push id40638
push userbmo:jhofmann@mozilla.com
push dateFri, 06 Jan 2017 13:00:27 +0000
reviewersdao
bugs1320314
milestone53.0a1
Bug 1320314 - Move popup notification layout overrides for arrow panels into a shared file. r=dao MozReview-Commit-ID: ELIY3j2jzPm
browser/themes/shared/notification-icons.inc.css
toolkit/modules/PopupNotifications.jsm
toolkit/themes/linux/global/global.css
toolkit/themes/linux/global/jar.mn
toolkit/themes/osx/global/global.css
toolkit/themes/shared/notification-popup.inc.css
toolkit/themes/windows/global/global.css
--- a/browser/themes/shared/notification-icons.inc.css
+++ b/browser/themes/shared/notification-icons.inc.css
@@ -34,28 +34,16 @@
 %ifdef MOZ_WIDGET_GTK
     list-style-image: url(moz-icon://stock/gtk-dialog-info?size=dialog);
 %else
     list-style-image: url(chrome://global/skin/icons/information-32.png);
 %endif
   }
 }
 
-#notification-popup > .panel-arrowcontainer > .panel-arrowcontent {
-  /* In order to display the action buttons near the edge of the arrow panel we
-   * have to reset its default padding and specify the padding in the individual
-   * "popupnotification" elements instead. To keep the rounded borders of the
-   * panel, we also have to ensure the contents are clipped to the border box
-   * by hiding the overflow, and we have to override the "display" property so
-   * that the height of the contents is computed correctly in that case. */
-  padding: 0;
-  overflow: hidden;
-  display: block;
-}
-
 .notification-anchor-icon:not(.plugin-blocked):-moz-lwtheme,
 #blocked-permissions-container > .blocked-permission-icon:-moz-lwtheme {
   filter: url(chrome://global/skin/filters.svg#fill);
   fill: currentColor;
 }
 
 .notification-anchor-icon:not(.plugin-blocked):not(:hover) {
   opacity: .8;
--- a/toolkit/modules/PopupNotifications.jsm
+++ b/toolkit/modules/PopupNotifications.jsm
@@ -213,16 +213,17 @@ this.PopupNotifications = function Popup
 
   this.window = tabbrowser.ownerDocument.defaultView;
   this.panel = panel;
   this.tabbrowser = tabbrowser;
   this.iconBox = iconBox;
   this.buttonDelay = Services.prefs.getIntPref(PREF_SECURITY_DELAY);
 
   this.panel.addEventListener("popuphidden", this, true);
+  this.panel.classList.add("popup-notification-panel");
 
   // This listener will be attached to the chrome window whenever a notification
   // is showing, to allow the user to dismiss notifications using the escape key.
   this._handleWindowKeyPress = aEvent => {
     if (aEvent.keyCode != aEvent.DOM_VK_ESCAPE) {
       return;
     }
 
--- a/toolkit/themes/linux/global/global.css
+++ b/toolkit/themes/linux/global/global.css
@@ -287,16 +287,18 @@ notification > button {
   margin-top: 0;
   margin-bottom: 0;
 }
 
 popupnotificationcontent {
   margin-top: .5em;
 }
 
+%include ../../shared/notification-popup.inc.css
+
 /* :::::: autoscroll popup ::::: */
 
 .autoscroller {
   height: 28px;
   width: 28px;
   border: none;
   margin: -14px;
   padding: 0;
--- a/toolkit/themes/linux/global/jar.mn
+++ b/toolkit/themes/linux/global/jar.mn
@@ -9,17 +9,17 @@ toolkit.jar:
    skin/classic/global/button.css
    skin/classic/global/checkbox.css
    skin/classic/global/colorpicker.css
    skin/classic/global/commonDialog.css
    skin/classic/global/dropmarker.css
    skin/classic/global/filepicker.css
    skin/classic/global/Filepicker.png                          (filepicker/Filepicker.png)
    skin/classic/global/findBar.css
-   skin/classic/global/global.css
+*  skin/classic/global/global.css
    skin/classic/global/groupbox.css
    skin/classic/global/listbox.css
    skin/classic/global/menu.css
    skin/classic/global/menulist.css
    skin/classic/global/netError.css
 *  skin/classic/global/notification.css
    skin/classic/global/numberbox.css
    skin/classic/global/popup.css
--- a/toolkit/themes/osx/global/global.css
+++ b/toolkit/themes/osx/global/global.css
@@ -273,16 +273,18 @@ notification > button:active:hover:-moz-
 notification > button > .button-box > .button-text {
   margin: 0 !important;
 }
 
 popupnotificationcontent {
   margin-top: .5em;
 }
 
+%include ../../shared/notification-popup.inc.css
+
 /* :::::: autoscroll popup ::::: */
 
 .autoscroller {
   height: 28px;
   width: 28px;
   border: none;
   margin: -14px;
   padding: 0;
new file mode 100644
--- /dev/null
+++ b/toolkit/themes/shared/notification-popup.inc.css
@@ -0,0 +1,11 @@
+.popup-notification-panel > .panel-arrowcontainer > .panel-arrowcontent {
+  /* In order to display the action buttons near the edge of the arrow panel we
+   * have to reset its default padding and specify the padding in the individual
+   * "popupnotification" elements instead. To keep the rounded borders of the
+   * panel, we also have to ensure the contents are clipped to the border box
+   * by hiding the overflow, and we have to override the "display" property so
+   * that the height of the contents is computed correctly in that case. */
+  padding: 0;
+  overflow: hidden;
+  display: block;
+}
--- a/toolkit/themes/windows/global/global.css
+++ b/toolkit/themes/windows/global/global.css
@@ -292,16 +292,18 @@ label[disabled="true"]:-moz-system-metri
 .text-link:-moz-focusring {
   outline: 1px dotted;
 }
 
 popupnotificationcontent {
   margin-top: .5em;
 }
 
+%include ../../shared/notification-popup.inc.css
+
 /* :::::: autoscroll popup ::::: */
 
 .autoscroller {
   height: 28px;
   width: 28px;
   border: none;
   margin: -14px;
   padding: 0;