Bumping manifests a=b2g-bump
[gecko.git] / layout / style / nsDOMCSSRGBColor.h
blob9b7f3854f2d924efbce1a117a9ed565f2c8bd642
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 /* DOM object representing color values in DOM computed style */
8 #ifndef nsDOMCSSRGBColor_h__
9 #define nsDOMCSSRGBColor_h__
11 #include "mozilla/Attributes.h"
12 #include "nsAutoPtr.h"
13 #include "nsWrapperCache.h"
15 class nsROCSSPrimitiveValue;
17 class nsDOMCSSRGBColor : public nsWrapperCache
19 public:
20 nsDOMCSSRGBColor(nsROCSSPrimitiveValue* aRed,
21 nsROCSSPrimitiveValue* aGreen,
22 nsROCSSPrimitiveValue* aBlue,
23 nsROCSSPrimitiveValue* aAlpha,
24 bool aHasAlpha);
26 NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(nsDOMCSSRGBColor)
28 NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(nsDOMCSSRGBColor)
30 bool HasAlpha() const { return mHasAlpha; }
32 // RGBColor webidl interface
33 nsROCSSPrimitiveValue* Red() const
35 return mRed;
37 nsROCSSPrimitiveValue* Green() const
39 return mGreen;
41 nsROCSSPrimitiveValue* Blue() const
43 return mBlue;
45 nsROCSSPrimitiveValue* Alpha() const
47 return mAlpha;
50 nsISupports* GetParentObject() const
52 return nullptr;
55 virtual JSObject *WrapObject(JSContext *cx)
56 MOZ_OVERRIDE MOZ_FINAL;
58 private:
59 virtual ~nsDOMCSSRGBColor(void);
61 nsRefPtr<nsROCSSPrimitiveValue> mRed;
62 nsRefPtr<nsROCSSPrimitiveValue> mGreen;
63 nsRefPtr<nsROCSSPrimitiveValue> mBlue;
64 nsRefPtr<nsROCSSPrimitiveValue> mAlpha;
65 bool mHasAlpha;
68 #endif // nsDOMCSSRGBColor_h__