Bug 1531836 - adjust Thunderbird code to use the 'icon' attribute to set the icon of XUL windows, r=mkmelin.
authorFlorian Quèze <florian@queze.net>
Fri, 01 Mar 2019 20:27:49 +0000
changeset 25986 0ec9e8d998fc4c7f18d3ea2e2854f077c10e0fbc
parent 25985 619c9cb3842e422e1631d1e10223de522f763912
child 25987 d314fcc86f6dfa46e53b34708aca27212f97a714
push id15599
push userfqueze@mozilla.com
push dateFri, 01 Mar 2019 20:31:57 +0000
treeherdercomm-central@0ec9e8d998fc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmkmelin
bugs1531836
Bug 1531836 - adjust Thunderbird code to use the 'icon' attribute to set the icon of XUL windows, r=mkmelin. Differential Revision: https://phabricator.services.mozilla.com/D21755
calendar/base/content/dialogs/calendar-alarm-dialog.xul
calendar/base/content/dialogs/calendar-dialog-utils.js
mail/base/content/messageWindow.xul
mail/base/content/messenger.xul
mail/components/addrbook/content/abEditCardDialog.xul
mail/components/addrbook/content/abNewCardDialog.xul
mail/components/addrbook/content/addressbook.xul
mail/components/compose/content/messengercompose.xul
--- a/calendar/base/content/dialogs/calendar-alarm-dialog.xul
+++ b/calendar/base/content/dialogs/calendar-alarm-dialog.xul
@@ -13,16 +13,17 @@
 <!-- used for textbox in the menupopup "snooze-menupopup" -->
 <?xml-stylesheet href="chrome://messenger/skin/spinbuttons.css" type="text/css"?>
 
 <!-- DTD File with all strings specific to the calendar -->
 <!DOCTYPE dialog SYSTEM "chrome://calendar/locale/calendar.dtd">
 
 <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         id="calendar-alarm-dialog"
+        icon="calendar-alarm-dialog"
         title="&calendar.alarm.title.label;"
         windowtype="Calendar:AlarmWindow"
         persist="screenX screenY width height"
         onload="setupWindow(); window.arguments[0].wrappedJSObject.window_onLoad();"
         onunload="finishWindow();"
         onfocus="onFocusWindow();"
         onkeypress="if (event.key == 'Escape') { window.close(); }"
         width="600"
--- a/calendar/base/content/dialogs/calendar-dialog-utils.js
+++ b/calendar/base/content/dialogs/calendar-dialog-utils.js
@@ -38,24 +38,25 @@ function intializeTabOrWindowVariables()
 function dispose() {
     let args = window.arguments[0];
     if (args.job && args.job.dispose) {
         args.job.dispose();
     }
 }
 
 /**
- * Sets the id of a Dialog to another value to allow different window-icons to be displayed.
- * The original name is stored as new Attribute of the Dialog to set it back later.
+ * Sets the id of a Dialog to another value to allow different styles and the icon
+ * attribute for window-icons to be displayed.
  *
  * @param aDialog               The Dialog to be changed.
  * @param aNewId                The new ID as String.
  */
 function setDialogId(aDialog, aNewId) {
     aDialog.setAttribute("id", aNewId);
+    aDialog.setAttribute("icon", aNewId);
     applyPersistedProperties(aDialog);
 }
 
 /**
  * Apply the persisted properties from xulstore.json on a dialog based on the current dialog id.
  * This needs to be invoked after changing a dialog id while loading to apply the values for the
  * new dialog id.
  *
--- a/mail/base/content/messageWindow.xul
+++ b/mail/base/content/messageWindow.xul
@@ -49,16 +49,17 @@
 ]>
 
 <!--
   - This window displays a single message.
   -->
 <window id="messengerWindow"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         xmlns:html="http://www.w3.org/1999/xhtml"
+        icon="messengerWindow"
         title="&titledefault.label;@PRE_RELEASE_SUFFIX@"
         titlemodifier="&titledefault.label;@PRE_RELEASE_SUFFIX@"
         titlemenuseparator="&titleSeparator.label;"
         onload="OnLoadMessageWindow()"
         onunload="OnUnloadMessageWindow()"
         persist="width height screenX screenY sizemode"
         toggletoolbar="true"
         windowtype="mail:messageWindow"
--- a/mail/base/content/messenger.xul
+++ b/mail/base/content/messenger.xul
@@ -61,16 +61,17 @@
 <!--
   - The 'what you think of when you think of thunderbird' window;
   -  3-pane view inside of tabs.
   -->
 <window id="messengerWindow"
         xmlns:html="http://www.w3.org/1999/xhtml"
         xmlns:svg="http://www.w3.org/2000/svg"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+        icon="messengerWindow"
         title="&titledefault.label;@PRE_RELEASE_SUFFIX@"
         titlemodifier="&titledefault.label;@PRE_RELEASE_SUFFIX@"
         titlemenuseparator="&titleSeparator.label;"
         defaultTabTitle="&defaultTabTitle.label;"
         onload="OnLoadMessenger()"
         onunload="OnUnloadMessenger()"
         screenX="10" screenY="10"
         persist="width height screenX screenY sizemode"
--- a/mail/components/addrbook/content/abEditCardDialog.xul
+++ b/mail/components/addrbook/content/abEditCardDialog.xul
@@ -8,16 +8,17 @@
 <?xml-stylesheet href="chrome://messenger/skin/addressbook/cardDialog.css" type="text/css"?>
 <?xml-stylesheet href="chrome://messenger/content/bindings.css" type="text/css"?>
 
 <!DOCTYPE dialog SYSTEM "chrome://messenger/locale/addressbook/abCard.dtd">
 
 <dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
   xmlns:html="http://www.w3.org/1999/xhtml"
   id="abcardWindow"
+  icon="abcardWindow"
   onload="OnLoadEditCard()"
   ondialogaccept="return EditCardOKButton();"
   ondialogcancel="return EditCardCancelButton();">
 
   <stringbundleset id="stringbundleset">
     <stringbundle id="bundle_addressBook" src="chrome://messenger/locale/addressbook/addressBook.properties"/>
   </stringbundleset>
 
--- a/mail/components/addrbook/content/abNewCardDialog.xul
+++ b/mail/components/addrbook/content/abNewCardDialog.xul
@@ -12,16 +12,17 @@
   %newCardDTD;
   <!ENTITY % abCardDTD SYSTEM "chrome://messenger/locale/addressbook/abCard.dtd">
   %abCardDTD;
 ]>
 
 <dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
     xmlns:html="http://www.w3.org/1999/xhtml"
     id="abcardWindow"
+    icon="abcardWindow"
     windowtype="mailnews:newcarddialog"
     onload="OnLoadNewCard()"
     ondialogaccept="return NewCardOKButton();"
     ondialogcancel="return NewCardCancelButton();">
 
   <stringbundleset id="stringbundleset">
     <stringbundle id="bundle_addressBook" src="chrome://messenger/locale/addressbook/addressBook.properties"/>
   </stringbundleset>
--- a/mail/components/addrbook/content/addressbook.xul
+++ b/mail/components/addrbook/content/addressbook.xul
@@ -19,16 +19,17 @@
 <!ENTITY % baseMenuOverlayDTD SYSTEM "chrome://messenger/locale/baseMenuOverlay.dtd">
 %baseMenuOverlayDTD;
 ]>
 
 <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
     xmlns:html="http://www.w3.org/1999/xhtml"
     id="addressbookWindow"
+    icon="addressbookWindow"
     title="&addressbookWindow.title;"
     windowtype="mail:addressbook"
     macanimationtype="document"
     persist="width height screenX screenY sizemode"
     toggletoolbar="true"
     onload="OnLoadAddressBook()"
     onunload="OnUnloadAddressBook()"
     lightweightthemes="true"
--- a/mail/components/compose/content/messengercompose.xul
+++ b/mail/components/compose/content/messengercompose.xul
@@ -35,16 +35,17 @@
     "chrome://communicator/locale/utilityOverlay.dtd">
   %utilityOverlayDTD;
 ]>
 
 <window id="msgcomposeWindow"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         xmlns:html="http://www.w3.org/1999/xhtml"
         xmlns:nc="http://home.netscape.com/NC-rdf#"
+        icon="msgcomposeWindow"
         onunload="ComposeUnload()"
         onload="ComposeLoad()"
         onclose="return DoCommandClose()"
         onfocus="EditorOnFocus()"
         title="&msgComposeWindow.title;"
         windowtype="msgcompose"
         macanimationtype="document"
         toggletoolbar="true"