Bug 1522451 - Resolve named CSS colors to RGB in Web Manifests r=marcosc
☠☠ backed out by 0ec36abbdb31 ☠ ☠
authorJames Willcox <snorp@snorp.net>
Thu, 14 Mar 2019 16:46:38 +0000
changeset 521942 5a892aa56e37
parent 521941 2ddf151f9535
child 521943 9f7a585bb83a
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;
   },
 };