1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/layout/style/nsDOMCSSRGBColor.cpp Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,39 @@ 1.4 +/* -*- 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 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.7 + 1.8 +/* DOM object representing color values in DOM computed style */ 1.9 + 1.10 +#include "nsDOMCSSRGBColor.h" 1.11 + 1.12 +#include "mozilla/dom/RGBColorBinding.h" 1.13 +#include "nsROCSSPrimitiveValue.h" 1.14 + 1.15 +using namespace mozilla; 1.16 + 1.17 +nsDOMCSSRGBColor::nsDOMCSSRGBColor(nsROCSSPrimitiveValue* aRed, 1.18 + nsROCSSPrimitiveValue* aGreen, 1.19 + nsROCSSPrimitiveValue* aBlue, 1.20 + nsROCSSPrimitiveValue* aAlpha, 1.21 + bool aHasAlpha) 1.22 + : mRed(aRed), mGreen(aGreen), mBlue(aBlue), mAlpha(aAlpha) 1.23 + , mHasAlpha(aHasAlpha) 1.24 +{ 1.25 + SetIsDOMBinding(); 1.26 +} 1.27 + 1.28 +nsDOMCSSRGBColor::~nsDOMCSSRGBColor(void) 1.29 +{ 1.30 +} 1.31 + 1.32 +NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_4(nsDOMCSSRGBColor, mAlpha, mBlue, mGreen, mRed) 1.33 + 1.34 +NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(nsDOMCSSRGBColor, AddRef) 1.35 +NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(nsDOMCSSRGBColor, Release) 1.36 + 1.37 +JSObject* 1.38 +nsDOMCSSRGBColor::WrapObject(JSContext *aCx) 1.39 +{ 1.40 + return dom::RGBColorBinding::Wrap(aCx, this); 1.41 +} 1.42 +