Fri, 16 Jan 2015 18:13:44 +0100
Integrate suggestion from review to improve consistency with existing code.
michael@0 | 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 |
michael@0 | 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 4 | |
michael@0 | 5 | /* DOM object representing color values in DOM computed style */ |
michael@0 | 6 | |
michael@0 | 7 | #include "nsDOMCSSRGBColor.h" |
michael@0 | 8 | |
michael@0 | 9 | #include "mozilla/dom/RGBColorBinding.h" |
michael@0 | 10 | #include "nsROCSSPrimitiveValue.h" |
michael@0 | 11 | |
michael@0 | 12 | using namespace mozilla; |
michael@0 | 13 | |
michael@0 | 14 | nsDOMCSSRGBColor::nsDOMCSSRGBColor(nsROCSSPrimitiveValue* aRed, |
michael@0 | 15 | nsROCSSPrimitiveValue* aGreen, |
michael@0 | 16 | nsROCSSPrimitiveValue* aBlue, |
michael@0 | 17 | nsROCSSPrimitiveValue* aAlpha, |
michael@0 | 18 | bool aHasAlpha) |
michael@0 | 19 | : mRed(aRed), mGreen(aGreen), mBlue(aBlue), mAlpha(aAlpha) |
michael@0 | 20 | , mHasAlpha(aHasAlpha) |
michael@0 | 21 | { |
michael@0 | 22 | SetIsDOMBinding(); |
michael@0 | 23 | } |
michael@0 | 24 | |
michael@0 | 25 | nsDOMCSSRGBColor::~nsDOMCSSRGBColor(void) |
michael@0 | 26 | { |
michael@0 | 27 | } |
michael@0 | 28 | |
michael@0 | 29 | NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_4(nsDOMCSSRGBColor, mAlpha, mBlue, mGreen, mRed) |
michael@0 | 30 | |
michael@0 | 31 | NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(nsDOMCSSRGBColor, AddRef) |
michael@0 | 32 | NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(nsDOMCSSRGBColor, Release) |
michael@0 | 33 | |
michael@0 | 34 | JSObject* |
michael@0 | 35 | nsDOMCSSRGBColor::WrapObject(JSContext *aCx) |
michael@0 | 36 | { |
michael@0 | 37 | return dom::RGBColorBinding::Wrap(aCx, this); |
michael@0 | 38 | } |
michael@0 | 39 |