2002-03-22 23:18:42 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* 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 23:18:42 +03:00
|
|
|
|
2006-03-25 08:47:31 +03:00
|
|
|
/* DOM object representing color values in DOM computed style */
|
|
|
|
|
2012-12-14 11:51:39 +04:00
|
|
|
#include "nsDOMCSSRGBColor.h"
|
|
|
|
|
|
|
|
#include "mozilla/dom/RGBColorBinding.h"
|
2002-03-22 23:18:42 +03:00
|
|
|
#include "nsISupports.h"
|
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
#include "nsIDOMCSSPrimitiveValue.h"
|
|
|
|
#include "nsContentUtils.h"
|
2012-10-20 22:04:36 +04:00
|
|
|
#include "nsROCSSPrimitiveValue.h"
|
2002-03-22 23:18:42 +03:00
|
|
|
|
2012-12-14 11:51:39 +04:00
|
|
|
using namespace mozilla;
|
|
|
|
|
2012-10-20 22:04:36 +04:00
|
|
|
nsDOMCSSRGBColor::nsDOMCSSRGBColor(nsROCSSPrimitiveValue* aRed,
|
|
|
|
nsROCSSPrimitiveValue* aGreen,
|
|
|
|
nsROCSSPrimitiveValue* aBlue,
|
|
|
|
nsROCSSPrimitiveValue* aAlpha,
|
2011-09-29 10:19:26 +04:00
|
|
|
bool aHasAlpha)
|
2007-01-25 05:03:02 +03:00
|
|
|
: mRed(aRed), mGreen(aGreen), mBlue(aBlue), mAlpha(aAlpha)
|
|
|
|
, mHasAlpha(aHasAlpha)
|
2002-03-22 23:18:42 +03:00
|
|
|
{
|
2012-12-14 11:51:39 +04:00
|
|
|
SetIsDOMBinding();
|
2002-03-22 23:18:42 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
nsDOMCSSRGBColor::~nsDOMCSSRGBColor(void)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2012-12-14 10:40:52 +04:00
|
|
|
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsDOMCSSRGBColor)
|
2002-03-22 23:18:42 +03:00
|
|
|
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
2012-12-14 10:40:52 +04:00
|
|
|
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
|
2002-03-22 23:18:42 +03:00
|
|
|
NS_INTERFACE_MAP_END
|
|
|
|
|
2012-12-14 10:40:52 +04:00
|
|
|
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_4(nsDOMCSSRGBColor, mAlpha, mBlue, mGreen, mRed)
|
|
|
|
NS_IMPL_CYCLE_COLLECTING_ADDREF(nsDOMCSSRGBColor)
|
|
|
|
NS_IMPL_CYCLE_COLLECTING_RELEASE(nsDOMCSSRGBColor)
|
2002-03-22 23:18:42 +03:00
|
|
|
|
2012-12-14 11:51:39 +04:00
|
|
|
JSObject*
|
|
|
|
nsDOMCSSRGBColor::WrapObject(JSContext *aCx, JSObject *aScope, bool *aTried)
|
|
|
|
{
|
|
|
|
return dom::RGBColorBinding::Wrap(aCx, aScope, this, aTried);
|
|
|
|
}
|
|
|
|
|