|
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/. */ |
|
4 |
|
5 /* DOM object representing color values in DOM computed style */ |
|
6 |
|
7 #include "nsDOMCSSRGBColor.h" |
|
8 |
|
9 #include "mozilla/dom/RGBColorBinding.h" |
|
10 #include "nsROCSSPrimitiveValue.h" |
|
11 |
|
12 using namespace mozilla; |
|
13 |
|
14 nsDOMCSSRGBColor::nsDOMCSSRGBColor(nsROCSSPrimitiveValue* aRed, |
|
15 nsROCSSPrimitiveValue* aGreen, |
|
16 nsROCSSPrimitiveValue* aBlue, |
|
17 nsROCSSPrimitiveValue* aAlpha, |
|
18 bool aHasAlpha) |
|
19 : mRed(aRed), mGreen(aGreen), mBlue(aBlue), mAlpha(aAlpha) |
|
20 , mHasAlpha(aHasAlpha) |
|
21 { |
|
22 SetIsDOMBinding(); |
|
23 } |
|
24 |
|
25 nsDOMCSSRGBColor::~nsDOMCSSRGBColor(void) |
|
26 { |
|
27 } |
|
28 |
|
29 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_4(nsDOMCSSRGBColor, mAlpha, mBlue, mGreen, mRed) |
|
30 |
|
31 NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(nsDOMCSSRGBColor, AddRef) |
|
32 NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(nsDOMCSSRGBColor, Release) |
|
33 |
|
34 JSObject* |
|
35 nsDOMCSSRGBColor::WrapObject(JSContext *aCx) |
|
36 { |
|
37 return dom::RGBColorBinding::Wrap(aCx, this); |
|
38 } |
|
39 |