2013-02-13 21:39:23 +00: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 11:12:37 +00: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/. */
|
2002-03-22 20:18:42 +00:00
|
|
|
|
2006-03-25 05:47:31 +00:00
|
|
|
/* DOM object representing color values in DOM computed style */
|
|
|
|
|
2012-12-14 07:51:39 +00:00
|
|
|
#include "nsDOMCSSRGBColor.h"
|
|
|
|
|
2002-03-22 20:18:42 +00:00
|
|
|
#include "nsContentUtils.h"
|
2013-03-03 00:31:48 +00:00
|
|
|
#include "mozilla/dom/RGBColorBinding.h"
|
2012-10-20 18:04:36 +00:00
|
|
|
#include "nsROCSSPrimitiveValue.h"
|
2002-03-22 20:18:42 +00:00
|
|
|
|
2012-12-14 07:51:39 +00:00
|
|
|
using namespace mozilla;
|
|
|
|
|
2012-10-20 18:04:36 +00:00
|
|
|
nsDOMCSSRGBColor::nsDOMCSSRGBColor(nsROCSSPrimitiveValue* aRed,
|
|
|
|
nsROCSSPrimitiveValue* aGreen,
|
|
|
|
nsROCSSPrimitiveValue* aBlue,
|
|
|
|
nsROCSSPrimitiveValue* aAlpha,
|
2011-09-29 06:19:26 +00:00
|
|
|
bool aHasAlpha)
|
2007-01-25 02:03:02 +00:00
|
|
|
: mRed(aRed), mGreen(aGreen), mBlue(aBlue), mAlpha(aAlpha)
|
|
|
|
, mHasAlpha(aHasAlpha)
|
2002-03-22 20:18:42 +00:00
|
|
|
{
|
2012-12-14 07:51:39 +00:00
|
|
|
SetIsDOMBinding();
|
2002-03-22 20:18:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
nsDOMCSSRGBColor::~nsDOMCSSRGBColor(void)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2012-12-14 06:40:52 +00:00
|
|
|
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_4(nsDOMCSSRGBColor, mAlpha, mBlue, mGreen, mRed)
|
2013-02-13 21:39:23 +00:00
|
|
|
|
|
|
|
NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(nsDOMCSSRGBColor, AddRef)
|
|
|
|
NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(nsDOMCSSRGBColor, Release)
|
2002-03-22 20:18:42 +00:00
|
|
|
|
2012-12-14 07:51:39 +00:00
|
|
|
JSObject*
|
2013-04-25 16:29:54 +00:00
|
|
|
nsDOMCSSRGBColor::WrapObject(JSContext *aCx, JS::Handle<JSObject*> aScope)
|
2012-12-14 07:51:39 +00:00
|
|
|
{
|
2013-03-11 23:03:47 +00:00
|
|
|
return dom::RGBColorBinding::Wrap(aCx, aScope, this);
|
2012-12-14 07:51:39 +00:00
|
|
|
}
|
|
|
|
|