Bug 1522451 - Resolve named CSS colors to RGB in Web Manifests r=marcosc
☠☠ backed out by 0ffd90627891 ☠ ☠
authorJames Willcox <snorp@snorp.net>
Thu, 14 Mar 2019 15:43:52 +0000
changeset 521892 bd7007ecd0db
parent 521891 d291cd16ef76
child 521893 da8f5a9fb9be
push id10870
push usernbeleuzu@mozilla.com
push dateFri, 15 Mar 2019 20:00:07 +0000
treeherdermozilla-beta@c594aee5b7a4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmarcosc
bugs1522451
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 1522451 - Resolve named CSS colors to RGB in Web Manifests r=marcosc Differential Revision: https://phabricator.services.mozilla.com/D23025
dom/manifest/ValueExtractor.jsm
--- a/dom/manifest/ValueExtractor.jsm
+++ b/dom/manifest/ValueExtractor.jsm
@@ -45,17 +45,20 @@ ValueExtractor.prototype = {
       return value.trim() || undefined;
     }
     return value;
   },
   extractColorValue(spec) {
     const value = this.extractValue(spec);
     let color;
     if (InspectorUtils.isValidCSSColor(value)) {
-      color = value;
+      const rgba = InspectorUtils.colorToRGBA(value);
+      color = "#" + ((rgba.r << 16) |
+        (rgba.g << 8) |
+        rgba.b).toString(16);
     } else if (value) {
       this.console.warn(this.domBundle.formatStringFromName("ManifestInvalidCSSColor",
                                                             [spec.property, value],
                                                             2));
     }
     return color;
   },
 };