Bug 1449200: Return icon URL for all sizes when processing an icon string. r?Gijs draft
authorKris Maglione <maglione.k@gmail.com>
Thu, 29 Mar 2018 17:01:06 -0700
changeset 775093 0e80b527a03b164dba05e21aecc01e9e1bbdb342
parent 775082 7fdb14ac881161d8dc429460d0aa373f4bbd9f39
push id104597
push usermaglione.k@gmail.com
push dateFri, 30 Mar 2018 00:01:27 +0000
reviewersGijs
bugs1449200
milestone61.0a1
Bug 1449200: Return icon URL for all sizes when processing an icon string. r?Gijs The CSS for page action icons doesn't handle fallback when only one variable is defined, so for widgets that don't define their icons using CSS, we always need to provide both. MozReview-Commit-ID: 7UgMSVS3W6K
browser/modules/PageActions.jsm
--- a/browser/modules/PageActions.jsm
+++ b/browser/modules/PageActions.jsm
@@ -687,19 +687,20 @@ Action.prototype = {
           "--pageAction-image-16px": escapeCSSURL(this._iconURLForSize(urls, 16)),
           "--pageAction-image-32px": escapeCSSURL(this._iconURLForSize(urls, 32)),
         });
         this._iconProperties.set(urls, props);
       }
       return props;
     }
 
+    let cssURL = urls ? escapeCSSURL(urls) : null;
     return Object.freeze({
-      "--pageAction-image-16px": null,
-      "--pageAction-image-32px": urls ? escapeCSSURL(urls) : null,
+      "--pageAction-image-16px": cssURL,
+      "--pageAction-image-32px": cssURL,
     });
   },
 
   /**
    * The action's title (string)
    */
   getTitle(browserWindow = null) {
     return this._getProperties(browserWindow).title;