Bug 1427419 - Part 10: Remove unused nsIDOMUtils.colorNameToRGB. r=bz
authorCameron McCormack <cam@mcc.id.au>
Thu, 11 Jan 2018 12:38:00 +0800
changeset 452989 b7386d96d8b2a219c922bc8e08fda5ccd051557a
parent 452988 3fab386062a12015871508c849ad398c3ef38cd5
child 452990 044e1b16df7658754e2fabfecf2adae9b3863550
push id1648
push usermtabara@mozilla.com
push dateThu, 01 Mar 2018 12:45:47 +0000
treeherdermozilla-release@cbb9688c2eeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs1427419
milestone59.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 1427419 - Part 10: Remove unused nsIDOMUtils.colorNameToRGB. r=bz MozReview-Commit-ID: 962UjCZqX6I
dom/webidl/InspectorUtils.webidl
layout/inspector/inDOMUtils.cpp
layout/inspector/inIDOMUtils.idl
--- a/dom/webidl/InspectorUtils.webidl
+++ b/dom/webidl/InspectorUtils.webidl
@@ -33,28 +33,16 @@ namespace InspectorUtils {
   sequence<DOMString> getCSSPropertyNames(optional PropertyNamesOptions options);
   [Throws] sequence<DOMString> getCSSValuesForProperty(DOMString property);
 };
 
 dictionary PropertyNamesOptions {
   boolean includeAliases = false;
 };
 
-dictionary InspectorRGBTriple {
-  /*
-   * NOTE: Using octet for RGB components is not generally OK, because
-   * they can be outside the 0-255 range, but for backwards-compatible
-   * named colors (which is what we use this dictionary for) the 0-255
-   * assumption is fine.
-   */
-  octet r = 0;
-  octet g = 0;
-  octet b = 0;
-};
-
 dictionary InspectorRGBATuple {
   /*
    * NOTE: This tuple is in the normal 0-255-sized RGB space but can be
    * fractional and may extend outside the 0-255 range.
    *
    * a is in the range 0 - 1.
    */
   double r = 0;
--- a/layout/inspector/inDOMUtils.cpp
+++ b/layout/inspector/inDOMUtils.cpp
@@ -854,37 +854,16 @@ InspectorUtils::GetCSSValuesForProperty(
   InsertNoDuplicates(aResult, NS_LITERAL_STRING("inherit"));
   InsertNoDuplicates(aResult, NS_LITERAL_STRING("unset"));
 }
 
 } // namespace dom
 } // namespace mozilla
 
 NS_IMETHODIMP
-inDOMUtils::ColorNameToRGB(const nsAString& aColorName, JSContext* aCx,
-                           JS::MutableHandle<JS::Value> aValue)
-{
-  nscolor color;
-  if (!NS_ColorNameToRGB(aColorName, &color)) {
-    return NS_ERROR_INVALID_ARG;
-  }
-
-  InspectorRGBTriple triple;
-  triple.mR = NS_GET_R(color);
-  triple.mG = NS_GET_G(color);
-  triple.mB = NS_GET_B(color);
-
-  if (!ToJSValue(aCx, triple, aValue)) {
-    return NS_ERROR_FAILURE;
-  }
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
 inDOMUtils::RgbToColorName(uint8_t aR, uint8_t aG, uint8_t aB,
                            nsAString& aColorName)
 {
   const char* color = NS_RGBToColorName(NS_RGB(aR, aG, aB));
   if (!color) {
     aColorName.Truncate();
     return NS_ERROR_INVALID_ARG;
   }
--- a/layout/inspector/inIDOMUtils.idl
+++ b/layout/inspector/inIDOMUtils.idl
@@ -16,18 +16,16 @@ interface nsIDOMNodeList;
 interface nsIDOMFontFaceList;
 interface nsIDOMRange;
 interface nsIDOMCSSStyleSheet;
 
 [scriptable, uuid(362e98c3-82c2-4ad8-8dcb-00e8e4eab497)]
 interface inIDOMUtils : nsISupports
 {
   // Utilities for working with CSS colors
-  [implicit_jscontext]
-  jsval colorNameToRGB(in DOMString aColorName);
   AString rgbToColorName(in octet aR, in octet aG, in octet aB);
 
   // Convert a given CSS color string to rgba. Returns null on failure or an
   // InspectorRGBATuple on success.
   //
   // NOTE: Converting a color to RGBA may be lossy when converting from some
   // formats e.g. CMYK.
   [implicit_jscontext]