2013-02-13 13:39:23 -08:00
|
|
|
/* -*- 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
|
2012-05-21 04:12:37 -07:00
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
/* DOM object representing color values in DOM computed style */
|
|
|
|
|
2012-12-13 23:51:39 -08:00
|
|
|
#include "nsDOMCSSRGBColor.h"
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
#include "nsContentUtils.h"
|
2013-03-02 16:31:48 -08:00
|
|
|
#include "mozilla/dom/RGBColorBinding.h"
|
2012-10-20 11:04:36 -07:00
|
|
|
#include "nsROCSSPrimitiveValue.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-12-13 23:51:39 -08:00
|
|
|
using namespace mozilla;
|
|
|
|
|
2012-10-20 11:04:36 -07:00
|
|
|
nsDOMCSSRGBColor::nsDOMCSSRGBColor(nsROCSSPrimitiveValue* aRed,
|
|
|
|
nsROCSSPrimitiveValue* aGreen,
|
|
|
|
nsROCSSPrimitiveValue* aBlue,
|
|
|
|
nsROCSSPrimitiveValue* aAlpha,
|
2011-09-28 23:19:26 -07:00
|
|
|
bool aHasAlpha)
|
2007-03-22 10:30:00 -07:00
|
|
|
: mRed(aRed), mGreen(aGreen), mBlue(aBlue), mAlpha(aAlpha)
|
|
|
|
, mHasAlpha(aHasAlpha)
|
|
|
|
{
|
2012-12-13 23:51:39 -08:00
|
|
|
SetIsDOMBinding();
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
nsDOMCSSRGBColor::~nsDOMCSSRGBColor(void)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2012-12-13 22:40:52 -08:00
|
|
|
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_4(nsDOMCSSRGBColor, mAlpha, mBlue, mGreen, mRed)
|
2013-02-13 13:39:23 -08:00
|
|
|
|
|
|
|
NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(nsDOMCSSRGBColor, AddRef)
|
|
|
|
NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(nsDOMCSSRGBColor, Release)
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-12-13 23:51:39 -08:00
|
|
|
JSObject*
|
2013-03-11 16:03:47 -07:00
|
|
|
nsDOMCSSRGBColor::WrapObject(JSContext *aCx, JSObject *aScope)
|
2012-12-13 23:51:39 -08:00
|
|
|
{
|
2013-03-11 16:03:47 -07:00
|
|
|
return dom::RGBColorBinding::Wrap(aCx, aScope, this);
|
2012-12-13 23:51:39 -08:00
|
|
|
}
|
|
|
|
|