Bug 1531836 - only look for a window specific icon on the disk if an 'icon' attribute has been specified on the XUL window, r=NeilDeakin.
authorFlorian Quèze <florian@queze.net>
Fri, 01 Mar 2019 18:32:17 +0000
changeset 461999 d8cdae952942c13e39008a5b6ab6400aa7cdfde1
parent 461998 a6c5017346c4e76ec597d64f3843b6d9553babbd
child 462000 b38cbb00d7dd7bfb9fecd81f08275dc0265ac7ca
push id35634
push userrmaries@mozilla.com
push dateSat, 02 Mar 2019 09:26:10 +0000
treeherdermozilla-central@4166cae81546 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersNeilDeakin
bugs1531836
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1531836 - only look for a window specific icon on the disk if an 'icon' attribute has been specified on the XUL window, r=NeilDeakin. Differential Revision: https://phabricator.services.mozilla.com/D21753
xpfe/appshell/nsXULWindow.cpp
--- a/xpfe/appshell/nsXULWindow.cpp
+++ b/xpfe/appshell/nsXULWindow.cpp
@@ -1501,24 +1501,23 @@ void nsXULWindow::SyncAttributesToWidget
   // "windowtype" attribute
   windowElement->GetAttribute(WINDOWTYPE_ATTRIBUTE, attr);
   if (!attr.IsEmpty()) {
     mWindow->SetWindowClass(attr);
   }
 
   NS_ENSURE_TRUE_VOID(mWindow);
 
-  // "id" attribute for icon
-  windowElement->GetAttribute(NS_LITERAL_STRING("id"), attr);
-  if (attr.IsEmpty()) {
-    attr.AssignLiteral("default");
+  // "icon" attribute
+  windowElement->GetAttribute(NS_LITERAL_STRING("icon"), attr);
+  if (!attr.IsEmpty()) {
+    mWindow->SetIcon(attr);
+
+    NS_ENSURE_TRUE_VOID(mWindow);
   }
-  mWindow->SetIcon(attr);
-
-  NS_ENSURE_TRUE_VOID(mWindow);
 
   // "drawtitle" attribute
   windowElement->GetAttribute(NS_LITERAL_STRING("drawtitle"), attr);
   mWindow->SetDrawsTitle(attr.LowerCaseEqualsLiteral("true"));
 
   NS_ENSURE_TRUE_VOID(mWindow);
 
   // "toggletoolbar" attribute