bug 824970 - nsROCSSPrimitiveValue::GetRectValue() should return nsDOMCSSRect* r=bz
authorTrevor Saunders <trev.saunders@gmail.com>
Wed, 26 Dec 2012 12:02:37 -0500
changeset 126322 cdc397a8e017d4523e2ced42dca1424265ed2dac
parent 126321 28042058474412c4d51267ecbe5478e65f72a86c
child 126323 0b34087f3e7d55ee2cfe2968703357a70a2f8656
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
bugs824970
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 824970 - nsROCSSPrimitiveValue::GetRectValue() should return nsDOMCSSRect* r=bz
dom/bindings/Bindings.conf
layout/style/nsROCSSPrimitiveValue.cpp
layout/style/nsROCSSPrimitiveValue.h
--- a/dom/bindings/Bindings.conf
+++ b/dom/bindings/Bindings.conf
@@ -153,17 +153,17 @@ DOMInterfaces = {
 },
 
 'CSS2Properties': {
   'nativeType': 'nsDOMCSSDeclaration'
 },
 
 "CSSPrimitiveValue": {
     "nativeType": "nsROCSSPrimitiveValue",
-    "resultNotAddRefed": ["GetRGBColorValue"]
+    "resultNotAddRefed": ["getRGBColorValue", "getRectValue"]
 },
 
 'CSSStyleDeclaration': {
   'nativeType': 'nsICSSDeclaration'
 },
 
 "CSSValue": {
   "concrete": False
--- a/layout/style/nsROCSSPrimitiveValue.cpp
+++ b/layout/style/nsROCSSPrimitiveValue.cpp
@@ -453,34 +453,33 @@ nsROCSSPrimitiveValue::GetCounterValue(n
 
 already_AddRefed<nsIDOMCounter>
 nsROCSSPrimitiveValue::GetCounterValue(ErrorResult& aRv)
 {
   aRv.Throw(NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR);
   return nullptr;
 }
 
-already_AddRefed<nsDOMCSSRect>
+nsDOMCSSRect*
 nsROCSSPrimitiveValue::GetRectValue(ErrorResult& aRv)
 {
   if (mType != CSS_RECT) {
     aRv.Throw(NS_ERROR_DOM_INVALID_ACCESS_ERR);
     return nullptr;
   }
 
   NS_ASSERTION(mValue.mRect, "mValue.mRect should never be null");
-  NS_ADDREF(mValue.mRect);
   return mValue.mRect;
 }
 
 NS_IMETHODIMP
 nsROCSSPrimitiveValue::GetRectValue(nsIDOMRect** aRect)
 {
   ErrorResult error;
-  *aRect = GetRectValue(error).get();
+  NS_IF_ADDREF(*aRect = GetRectValue(error));
   return error.ErrorCode();
 }
 
 nsDOMCSSRGBColor*
 nsROCSSPrimitiveValue::GetRGBColorValue(ErrorResult& aRv)
 {
   if (mType != CSS_RGBCOLOR) {
     aRv.Throw(NS_ERROR_DOM_INVALID_ACCESS_ERR);
--- a/layout/style/nsROCSSPrimitiveValue.h
+++ b/layout/style/nsROCSSPrimitiveValue.h
@@ -50,17 +50,17 @@ public:
   }
   void SetFloatValue(uint16_t aUnitType, float aValue,
                      mozilla::ErrorResult& aRv);
   float GetFloatValue(uint16_t aUnitType, mozilla::ErrorResult& aRv);
   void GetStringValue(nsString& aString, mozilla::ErrorResult& aRv);
   void SetStringValue(uint16_t aUnitType, const nsAString& aString,
                       mozilla::ErrorResult& aRv);
   already_AddRefed<nsIDOMCounter> GetCounterValue(mozilla::ErrorResult& aRv);
-  already_AddRefed<nsDOMCSSRect> GetRectValue(mozilla::ErrorResult& aRv);
+  nsDOMCSSRect* GetRectValue(mozilla::ErrorResult& aRv);
   nsDOMCSSRGBColor *GetRGBColorValue(mozilla::ErrorResult& aRv);
 
   // nsROCSSPrimitiveValue
   nsROCSSPrimitiveValue();
   ~nsROCSSPrimitiveValue();
 
   void SetNumber(float aValue);
   void SetNumber(int32_t aValue);