michael@0: /* -*- 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 michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: /* DOM object representing color values in DOM computed style */ michael@0: michael@0: #include "nsDOMCSSRGBColor.h" michael@0: michael@0: #include "mozilla/dom/RGBColorBinding.h" michael@0: #include "nsROCSSPrimitiveValue.h" michael@0: michael@0: using namespace mozilla; michael@0: michael@0: nsDOMCSSRGBColor::nsDOMCSSRGBColor(nsROCSSPrimitiveValue* aRed, michael@0: nsROCSSPrimitiveValue* aGreen, michael@0: nsROCSSPrimitiveValue* aBlue, michael@0: nsROCSSPrimitiveValue* aAlpha, michael@0: bool aHasAlpha) michael@0: : mRed(aRed), mGreen(aGreen), mBlue(aBlue), mAlpha(aAlpha) michael@0: , mHasAlpha(aHasAlpha) michael@0: { michael@0: SetIsDOMBinding(); michael@0: } michael@0: michael@0: nsDOMCSSRGBColor::~nsDOMCSSRGBColor(void) michael@0: { michael@0: } michael@0: michael@0: NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_4(nsDOMCSSRGBColor, mAlpha, mBlue, mGreen, mRed) michael@0: michael@0: NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(nsDOMCSSRGBColor, AddRef) michael@0: NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(nsDOMCSSRGBColor, Release) michael@0: michael@0: JSObject* michael@0: nsDOMCSSRGBColor::WrapObject(JSContext *aCx) michael@0: { michael@0: return dom::RGBColorBinding::Wrap(aCx, this); michael@0: } michael@0: