Bug 1507245 - Rename xbl notification element to xbl-notification. r=mkmelin
authorArshad Khan <arshdkhn1@gmail.com> and Richard Marti <richard.marti@gmail.com>
Thu, 15 Nov 2018 06:18:30 +0530
changeset 32862 3f6a3f235390f882310127aa37bbb6750ee559bb
parent 32861 9e43ff6048ca92b12a036afd30c3f16848595c0c
child 32863 c7cda013b0b433778d7f9a64b12823ab6c40f01c
push id2343
push userclokep@gmail.com
push dateMon, 10 Dec 2018 21:37:21 +0000
treeherdercomm-beta@a0750c375f71 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmkmelin
bugs1507245
Bug 1507245 - Rename xbl notification element to xbl-notification. r=mkmelin
calendar/base/content/dialogs/calendar-event-dialog-reminder.js
calendar/base/themes/common/calendar-alarms.css
calendar/providers/gdata/content/gdata-event-dialog-reminder.css
calendar/providers/gdata/content/gdata-event-dialog-reminder.js
common/bindings/notificationbox.xml
mail/base/content/bindings.css
mail/components/im/themes/imAccounts.css
mail/themes/osx/mail/messenger.css
mail/themes/shared/jar.inc.mn
mail/themes/shared/mail/messenger.css
mail/themes/shared/mail/messengercompose.css
mail/themes/shared/mail/xbl-notification.css
--- a/calendar/base/content/dialogs/calendar-event-dialog-reminder.js
+++ b/calendar/base/content/dialogs/calendar-event-dialog-reminder.js
@@ -164,17 +164,17 @@ function setupMaxReminders() {
     // true/null. The former is needed for setElementValue.
     let cond = (maxReminders != null && listbox.childNodes.length >= maxReminders);
 
     // If we hit the maximum number of reminders, show the error box and
     // disable the new button.
     setElementValue("reminder-new-button", cond && "true", "disabled");
 
     if (!setupMaxReminders.notification) {
-        let notification = createXULElement("notification");
+        let notification = createXULElement("xbl-notification");
         let localeErrorString =
             cal.l10n.getString("calendar-alarms",
                                getItemBundleStringName("reminderErrorMaxCountReached"),
                                [maxReminders]);
         let pluralErrorLabel = PluralForm.get(maxReminders, localeErrorString)
                                          .replace("#1", maxReminders);
 
         notification.setAttribute("label", pluralErrorLabel);
--- a/calendar/base/themes/common/calendar-alarms.css
+++ b/calendar/base/themes/common/calendar-alarms.css
@@ -49,21 +49,21 @@
 #reminder-actions-menulist > menupopup > menuitem > .menu-iconic-left {
     display: -moz-box;
 }
 
 #reminder-notifications {
     overflow-y: visible;
 }
 
-#reminder-notifications > notification {
+#reminder-notifications > xbl-notification {
     background-color: transparent;
     border-width: 0;
 }
-#reminder-notifications > notification[type="warning"] > hbox > .messageImage {
+#reminder-notifications > xbl-notification[type="warning"] > hbox > .messageImage {
     width: 32px;
     height: 32px;
     fill: #ffbf00;
 }
 
 #reminder-actions-caption,
 #reminder-details-caption,
 #calendar-event-dialog-reminder > .dialog-button-box {
--- a/calendar/providers/gdata/content/gdata-event-dialog-reminder.css
+++ b/calendar/providers/gdata/content/gdata-event-dialog-reminder.css
@@ -1,11 +1,11 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 .reminder-icon[value="SMS"] {
   list-style-image: url(chrome://gdata-provider/skin/reminder-action-sms.svg);
 }
 
-#reminder-notifications > notification[type="critical"] {
+#reminder-notifications > xbl-notification[type="critical"] {
   background-color: #d70022;
 }
--- a/calendar/providers/gdata/content/gdata-event-dialog-reminder.js
+++ b/calendar/providers/gdata/content/gdata-event-dialog-reminder.js
@@ -10,17 +10,17 @@
     // NOTE: This function exits early if its not a gdata calendar
     let item = window.arguments[0].item;
     let calendar = window.arguments[0].calendar;
     if (calendar.type != "gdata") {
         return;
     }
 
     let label = getProviderString("reminderOutOfRange");
-    let notification = createXULElement("notification");
+    let notification = createXULElement("xbl-notification");
     notification.setAttribute("label", label);
     notification.setAttribute("type", "critical");
     notification.setAttribute("hideclose", "true");
 
     function checkReminderRange(reminder) {
         let offset = cal.alarms.calculateAlarmOffset(item, reminder);
         let seconds = offset.inSeconds;
         return (seconds < 1 && seconds >= FOUR_WEEKS_BEFORE);
--- a/common/bindings/notificationbox.xml
+++ b/common/bindings/notificationbox.xml
@@ -15,17 +15,17 @@
           xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
           xmlns:html = "http://www.w3.org/1999/xhtml">
 
   <binding id="notificationbox">
     <content>
       <xul:stack xbl:inherits="hidden=notificationshidden"
                  class="notificationbox-stack">
         <xul:spacer/>
-        <children includes="notification"/>
+        <children includes="xbl-notification"/>
       </xul:stack>
       <children/>
     </content>
 
     <implementation>
       <field name="PRIORITY_INFO_LOW" readonly="true">1</field>
       <field name="PRIORITY_INFO_MEDIUM" readonly="true">2</field>
       <field name="PRIORITY_INFO_HIGH" readonly="true">3</field>
@@ -64,17 +64,17 @@
           ]]>
         </setter>
       </property>
 
       <property name="allNotifications" readonly="true">
         <getter>
           <![CDATA[
             var closedNotification = this._closedNotification;
-            var notifications = this.getElementsByTagName("notification");
+            var notifications = this.getElementsByTagName("xbl-notification");
             return Array.filter(notifications, n => n != closedNotification);
           ]]>
         </getter>
       </property>
 
       <method name="getNotificationWithValue">
         <parameter name="aValue"/>
         <body>
@@ -107,17 +107,17 @@
             var notifications = this.allNotifications;
             var insertPos = null;
             for (var n = notifications.length - 1; n >= 0; n--) {
               if (notifications[n].priority < aPriority)
                 break;
               insertPos = notifications[n];
             }
 
-            var newitem = document.createXULElement("notification");
+            var newitem = document.createXULElement("xbl-notification");
             // Can't use instanceof in case this was created from a different document:
             let labelIsDocFragment = aLabel && typeof aLabel == "object" && aLabel.nodeType &&
                                      aLabel.nodeType == aLabel.DOCUMENT_FRAGMENT_NODE;
             if (!labelIsDocFragment)
               newitem.setAttribute("label", aLabel);
             newitem.setAttribute("value", aValue);
             if (aImage)
               newitem.setAttribute("image", aImage);
@@ -384,17 +384,17 @@
           ]]>
         </body>
       </method>
 
     </implementation>
 
     <handlers>
       <handler event="transitionend"><![CDATA[
-        if (event.target.localName == "notification" &&
+        if (event.target.localName == "xbl-notification" &&
             event.propertyName == "margin-top")
           this._finishAnimation();
       ]]></handler>
     </handlers>
 
   </binding>
 
   <binding id="notification">
--- a/mail/base/content/bindings.css
+++ b/mail/base/content/bindings.css
@@ -1,14 +1,15 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 @import url("chrome://global/skin/textbox.css");
 @import url("chrome://messenger/skin/numberbox.css");
+@import url("chrome://messenger/skin/xbl-notification.css");
 @import url("chrome://messenger/skin/spinbuttons.css");
 @import url("chrome://messenger/skin/datetimepicker.css");
 @import url("chrome://messenger/content/menulist.css");
 
 @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
 
 toolbox {
   -moz-binding: url("chrome://messenger/content/toolbar.xml#toolbox");
@@ -46,17 +47,17 @@ toolbarpaletteitem[place="palette"] {
 notificationbox {
   -moz-binding: url("chrome://messenger/content/notificationbox.xml#notificationbox");
   -moz-box-orient: vertical;
 }
 .notificationbox-stack {
   overflow: -moz-hidden-unscrollable;
 }
 
-notification {
+xbl-notification {
   -moz-binding: url("chrome://messenger/content/notificationbox.xml#notification");
 }
 
 button[type="menu-button"] {
   -moz-binding: url("chrome://messenger/content/menubutton.xml#menu-button");
 }
 
 menulist[type="description"] {
--- a/mail/components/im/themes/imAccounts.css
+++ b/mail/components/im/themes/imAccounts.css
@@ -6,17 +6,17 @@
 
 #accountManager {
   background-color: ThreeDFace;
   padding: 0 0;
   margin: 0 0;
 }
 
 %ifndef XP_MACOSX
-notification > hbox {
+xbl-notification > hbox {
   border: none !important;
   border-bottom: 1px solid ThreeDShadow !important;
 }
 %endif
 
 #accountsNotificationBox {
   margin: 0 0;
   -moz-appearance: none;
--- a/mail/themes/osx/mail/messenger.css
+++ b/mail/themes/osx/mail/messenger.css
@@ -565,43 +565,16 @@ treecol.treecol-image:hover:active {
 
 :root[lwt-tree-brighttext] #threadTree treechildren::-moz-tree-row(untagged, selected),
 :root[lwt-tree-brighttext] tree:not(#threadTree) treechildren::-moz-tree-row(selected),
 :root[lwt-tree-brighttext]:-moz-window-inactive #threadTree treechildren::-moz-tree-row(selected) {
   border-color: var(--sidebar-highlight-background-color, rgba(249,249,250,.1));
   background: var(--sidebar-highlight-background-color, rgba(249,249,250,.1));
 }
 
-/* ::::: Notifications ::::: */
-
-notification[value="addon-install-blocked"] > button,
-notification[value="addon-install-failed"] > button,
-notification[value="addon-install-complete"] > button {
-  padding: 1px 4px;
-  border-radius: var(--toolbarbutton-border-radius);
-  border: 1px solid rgba(60, 73, 97, 0.5);
-  box-shadow: inset 0 1px rgba(255, 255, 255, 0.25),
-              0 1px rgba(255, 255, 255, 0.25);
-  background-image: linear-gradient(rgba(255, 255, 255, 0.45),
-                                    rgba(255, 255, 255, 0.2));
-  background-clip: padding-box;
-  color: #252F3B;
-}
-
-notification[value="addon-install-blocked"] > button:active:hover,
-notification[value="addon-install-failed"] > button:active:hover,
-notification[value="addon-install-complete"] > button:active:hover {
-  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2),
-              0 1px rgba(255, 255, 255, 0.25);
-  background-color: transparent;
-  background-image: linear-gradient(rgba(45, 54, 71, 0.3),
-                                    rgba(45, 54, 71, 0.1));
-  border-color: rgba(60, 73, 97, 0.7);
-}
-
 /* ::::: Tabs in Titlebar :::::: */
 
 /**
  * For tabs in titlebar on OS X, we stretch the titlebar down so that the
  * tabstrip can overlap it.
  */
 #messengerWindow[tabsintitlebar] > #titlebar {
   min-height: calc(var(--tab-min-height) + var(--space-above-tabbar));
--- a/mail/themes/shared/jar.inc.mn
+++ b/mail/themes/shared/jar.inc.mn
@@ -4,16 +4,17 @@
 
 # This is not a complete / proper jar manifest. It is included by the
 # actual theme-specific manifests, so that shared resources need only
 # be specified once. As a result, the source file paths are relative
 # to the location of the actual manifest.
 
   skin/classic/messenger/aboutNetError.css                    (../shared/mail/aboutNetError.css)
   skin/classic/messenger/aboutSupport.css                     (../shared/mail/aboutSupport.css)
+  skin/classic/messenger/xbl-notification.css                 (../shared/mail/xbl-notification.css)
   skin/classic/messenger/addressbook/icons/menu.svg           (../shared/mail/icons/menu.svg)
   skin/classic/messenger/downloads/download.svg               (../shared/mail/icons/download.svg)
   skin/classic/messenger/extensionsOverlay.css                (../shared/mail/extensionsOverlay.css)
   skin/classic/messenger/icons/address.svg                    (../shared/mail/icons/address.svg)
   skin/classic/messenger/icons/addcontact.svg                 (../shared/mail/icons/addcontact.svg)
   skin/classic/messenger/icons/addlist.svg                    (../shared/mail/icons/addlist.svg)
   skin/classic/messenger/icons/accounts.svg                   (../shared/mail/icons/accounts.svg)
   skin/classic/messenger/icons/appbutton.svg                  (../shared/mail/icons/appbutton.svg)
--- a/mail/themes/shared/mail/messenger.css
+++ b/mail/themes/shared/mail/messenger.css
@@ -210,30 +210,16 @@ statusbarpanel,
   list-style-image: url("chrome://messenger/skin/icons/online.png");
   -moz-appearance: none;
 }
 
 #offline-status[offline="true"] {
   list-style-image: url("chrome://messenger/skin/icons/offline.png");
 }
 
-/* ::::: Notifications ::::: */
-
-notification {
-  padding-bottom: 2px;
-}
-
-notification[type="warning"] {
-  background: #ffc;
-}
-
-notification[value="draftMsgContent"] .messageImage {
-  list-style-image: url("chrome://messenger/skin/icons/newmsg.svg");
-}
-
 /* ::::: searchTermOverlay ::::: */
 
 #searchTermList > richlistitem[highlight = "true"] {
   animation: highlight .4s ease-in;
 }
 
 @keyframes highlight {
   from { background-color: Highlight; }
--- a/mail/themes/shared/mail/messengercompose.css
+++ b/mail/themes/shared/mail/messengercompose.css
@@ -291,17 +291,17 @@
 }
 
 /* ::::: attachment reminder ::::: */
 
 #attachmentNotificationBox b {
   font-weight: bold;
 }
 
-#attachmentNotificationBox > notification[image="null"] .messageImage {
+#attachmentNotificationBox > xbl-notification[image="null"] .messageImage {
   background-image: url("chrome://messenger/skin/icons/attach.svg");
 }
 
 #attachmentReminderText {
   margin-inline-start: 0;
   cursor: pointer;
 }
 
new file mode 100644
--- /dev/null
+++ b/mail/themes/shared/mail/xbl-notification.css
@@ -0,0 +1,59 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
+
+xbl-notification {
+  padding: 2px 0;
+  padding-inline-start: 12px;
+  background: -moz-dialog;
+  color: -moz-dialogText;
+  border-color: ThreeDLightShadow;
+  border-style: solid;
+  border-width: 1px 0;
+  text-shadow: none;
+}
+
+xbl-notification.animated {
+  transition: margin-top 300ms var(--animation-easing-function), opacity 300ms var(--animation-easing-function);
+}
+
+notificationbox[notificationside="top"] xbl-notification {
+  border-top-style: none;
+}
+
+notificationbox[notificationside="bottom"] xbl-notification {
+  border-bottom-style: none;
+}
+
+xbl-notification[type="warning"],
+xbl-notification[type="critical"] {
+  border-color: rgba(12, 12, 13, 0.2);
+}
+
+xbl-notification[type="warning"] {
+  background: #ffc;
+  color: #0c0c0d;
+}
+
+xbl-notification[type="critical"] {
+  background: #d70022;
+  color: #fff;
+}
+
+xbl-notification[type="info"] > hbox > .messageImage {
+  list-style-image: url("chrome://global/skin/icons/help.svg");
+}
+
+xbl-notification[type="warning"] > hbox > .messageImage {
+  list-style-image: url("chrome://global/skin/icons/warning.svg");
+}
+
+xbl-notification[type="critical"] > hbox > .messageImage {
+  list-style-image: url("chrome://global/skin/icons/error.svg");
+}
+
+xbl-notification[value="draftMsgContent"] > hbox > .messageImage {
+  list-style-image: url("chrome://messenger/skin/icons/newmsg.svg");
+}