nsDOMCSSRGBColor.cpp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /* -*- 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
  2. * License, v. 2.0. If a copy of the MPL was not distributed with this
  3. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  4. /* DOM object representing color values in DOM computed style */
  5. #include "nsDOMCSSRGBColor.h"
  6. #include "mozilla/dom/RGBColorBinding.h"
  7. #include "nsROCSSPrimitiveValue.h"
  8. using namespace mozilla;
  9. nsDOMCSSRGBColor::nsDOMCSSRGBColor(nsROCSSPrimitiveValue* aRed,
  10. nsROCSSPrimitiveValue* aGreen,
  11. nsROCSSPrimitiveValue* aBlue,
  12. nsROCSSPrimitiveValue* aAlpha,
  13. bool aHasAlpha)
  14. : mRed(aRed), mGreen(aGreen), mBlue(aBlue), mAlpha(aAlpha)
  15. , mHasAlpha(aHasAlpha)
  16. {
  17. }
  18. nsDOMCSSRGBColor::~nsDOMCSSRGBColor(void)
  19. {
  20. }
  21. NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(nsDOMCSSRGBColor, mAlpha, mBlue, mGreen, mRed)
  22. NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(nsDOMCSSRGBColor, AddRef)
  23. NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(nsDOMCSSRGBColor, Release)
  24. JSObject*
  25. nsDOMCSSRGBColor::WrapObject(JSContext *aCx, JS::Handle<JSObject*> aGivenProto)
  26. {
  27. return dom::RGBColorBinding::Wrap(aCx, this, aGivenProto);
  28. }