bug 821593 - GetRGBColorValue() should return nsDOMCSSRGBColor* r=bz

This commit is contained in:
Trevor Saunders 2012-10-24 20:43:56 -04:00
parent 6316ea3cdf
commit f66d567a5c
3 changed files with 6 additions and 5 deletions

View File

@ -149,7 +149,8 @@ DOMInterfaces = {
},
"CSSPrimitiveValue": {
"nativeType": "nsROCSSPrimitiveValue"
"nativeType": "nsROCSSPrimitiveValue",
"resultNotAddRefed": ["GetRGBColorValue"]
},
'CSSStyleDeclaration': {

View File

@ -495,19 +495,19 @@ NS_IMETHODIMP
nsROCSSPrimitiveValue::GetRGBColorValue(nsIDOMRGBColor** aColor)
{
ErrorResult error;
*aColor = GetRGBColorValue(error).get();
NS_IF_ADDREF(*aColor = GetRGBColorValue(error));
return error.ErrorCode();
}
already_AddRefed<nsIDOMRGBColor>
nsDOMCSSRGBColor*
nsROCSSPrimitiveValue::GetRGBColorValue(ErrorResult& aRv)
{
if (mType != CSS_RGBCOLOR) {
aRv.Throw(NS_ERROR_DOM_INVALID_ACCESS_ERR);
return nullptr;
}
NS_ASSERTION(mValue.mColor, "mValue.mColor should never be null");
NS_ADDREF(mValue.mColor);
return mValue.mColor;
}

View File

@ -55,7 +55,7 @@ public:
mozilla::ErrorResult& aRv);
already_AddRefed<nsIDOMCounter> GetCounterValue(mozilla::ErrorResult& aRv);
already_AddRefed<nsIDOMRect> GetRectValue(mozilla::ErrorResult& aRv);
already_AddRefed<nsIDOMRGBColor> GetRGBColorValue(mozilla::ErrorResult& aRv);
nsDOMCSSRGBColor *GetRGBColorValue(mozilla::ErrorResult& aRv);
// nsROCSSPrimitiveValue
nsROCSSPrimitiveValue();