1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 /* DOM object representing color values in DOM computed style */
7 #include "nsDOMCSSRGBColor.h"
9 #include "mozilla/dom/RGBColorBinding.h"
10 #include "nsROCSSPrimitiveValue.h"
12 using namespace mozilla
;
14 nsDOMCSSRGBColor::nsDOMCSSRGBColor(nsROCSSPrimitiveValue
* aRed
,
15 nsROCSSPrimitiveValue
* aGreen
,
16 nsROCSSPrimitiveValue
* aBlue
,
17 nsROCSSPrimitiveValue
* aAlpha
,
19 : mRed(aRed
), mGreen(aGreen
), mBlue(aBlue
), mAlpha(aAlpha
)
20 , mHasAlpha(aHasAlpha
)
25 nsDOMCSSRGBColor::~nsDOMCSSRGBColor(void)
29 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(nsDOMCSSRGBColor
, mAlpha
, mBlue
, mGreen
, mRed
)
31 NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(nsDOMCSSRGBColor
, AddRef
)
32 NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(nsDOMCSSRGBColor
, Release
)
35 nsDOMCSSRGBColor::WrapObject(JSContext
*aCx
)
37 return dom::RGBColorBinding::Wrap(aCx
, this);