bug 821593 - don't use nsIDOMRGBColor xpcom methods in nsROCSSPrimitiveValue r=bz
authorTrevor Saunders <trev.saunders@gmail.com>
Fri, 14 Dec 2012 04:32:07 -0500
changeset 125360 ed93f3e4a53f53ee86f6766d52252e720119556b
parent 125359 6272bd19f4510120bfec683a1b24d35728c92807
child 125361 b2b54e759cb9a33f4a67643c3e8e6f2e4a33b919
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs821593
milestone20.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 821593 - don't use nsIDOMRGBColor xpcom methods in nsROCSSPrimitiveValue r=bz
layout/style/nsROCSSPrimitiveValue.cpp
--- a/layout/style/nsROCSSPrimitiveValue.cpp
+++ b/layout/style/nsROCSSPrimitiveValue.cpp
@@ -175,58 +175,46 @@ nsROCSSPrimitiveValue::GetCssText(nsAStr
         if (NS_FAILED(result))
           break;
         tmpStr.Append(sideValue + NS_LITERAL_STRING(")"));
         break;
       }
     case CSS_RGBCOLOR :
       {
         NS_ASSERTION(mValue.mColor, "mValue.mColor should never be null");
+        ErrorResult error;
         NS_NAMED_LITERAL_STRING(comma, ", ");
-        nsCOMPtr<nsIDOMCSSPrimitiveValue> colorCSSValue;
         nsAutoString colorValue;
         if (mValue.mColor->HasAlpha())
           tmpStr.AssignLiteral("rgba(");
         else
           tmpStr.AssignLiteral("rgb(");
 
         // get the red component
-        result = mValue.mColor->GetRed(getter_AddRefs(colorCSSValue));
-        if (NS_FAILED(result))
-          break;
-        result = colorCSSValue->GetCssText(colorValue);
-        if (NS_FAILED(result))
+        mValue.mColor->Red()->GetCssText(colorValue, error);
+        if (error.Failed())
           break;
         tmpStr.Append(colorValue + comma);
 
         // get the green component
-        result = mValue.mColor->GetGreen(getter_AddRefs(colorCSSValue));
-        if (NS_FAILED(result))
-          break;
-        result = colorCSSValue->GetCssText(colorValue);
-        if (NS_FAILED(result))
+        mValue.mColor->Green()->GetCssText(colorValue, error);
+        if (error.Failed())
           break;
         tmpStr.Append(colorValue + comma);
 
         // get the blue component
-        result = mValue.mColor->GetBlue(getter_AddRefs(colorCSSValue));
-        if (NS_FAILED(result))
-          break;
-        result = colorCSSValue->GetCssText(colorValue);
-        if (NS_FAILED(result))
+        mValue.mColor->Blue()->GetCssText(colorValue, error);
+        if (error.Failed())
           break;
         tmpStr.Append(colorValue);
 
         if (mValue.mColor->HasAlpha()) {
           // get the alpha component
-          result = mValue.mColor->GetAlpha(getter_AddRefs(colorCSSValue));
-          if (NS_FAILED(result))
-            break;
-          result = colorCSSValue->GetCssText(colorValue);
-          if (NS_FAILED(result))
+          mValue.mColor->Alpha()->GetCssText(colorValue, error);
+          if (error.Failed())
             break;
           tmpStr.Append(comma + colorValue);
         }
 
         tmpStr.Append(NS_LITERAL_STRING(")"));
 
         break;
       }