SVGAnimatedLength.cpp 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /* -*- Mode: C++; tab-width: 8; 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/. */
  5. #include "mozilla/dom/SVGAnimatedLength.h"
  6. #include "mozilla/dom/SVGAnimatedLengthBinding.h"
  7. #include "nsSVGLength2.h"
  8. #include "DOMSVGLength.h"
  9. namespace mozilla {
  10. namespace dom {
  11. NS_SVG_VAL_IMPL_CYCLE_COLLECTION_WRAPPERCACHED(SVGAnimatedLength, mSVGElement)
  12. NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(SVGAnimatedLength, AddRef)
  13. NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(SVGAnimatedLength, Release)
  14. JSObject*
  15. SVGAnimatedLength::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
  16. {
  17. return SVGAnimatedLengthBinding::Wrap(aCx, this, aGivenProto);
  18. }
  19. already_AddRefed<DOMSVGLength>
  20. SVGAnimatedLength::BaseVal()
  21. {
  22. RefPtr<DOMSVGLength> angle;
  23. mVal->ToDOMBaseVal(getter_AddRefs(angle), mSVGElement);
  24. return angle.forget();
  25. }
  26. already_AddRefed<DOMSVGLength>
  27. SVGAnimatedLength::AnimVal()
  28. {
  29. RefPtr<DOMSVGLength> angle;
  30. mVal->ToDOMAnimVal(getter_AddRefs(angle), mSVGElement);
  31. return angle.forget();
  32. }
  33. } // namespace dom
  34. } // namespace mozilla