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 #include "SVGAnimatedRect.h"
7 #include "mozilla/dom/SVGAnimatedRectBinding.h"
8 #include "nsSVGElement.h"
9 #include "nsSVGViewBox.h"
15 NS_SVG_VAL_IMPL_CYCLE_COLLECTION_WRAPPERCACHED(SVGAnimatedRect
, mSVGElement
)
17 NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(SVGAnimatedRect
, AddRef
)
18 NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(SVGAnimatedRect
, Release
)
20 SVGAnimatedRect::SVGAnimatedRect(nsSVGViewBox
* aVal
, nsSVGElement
* aSVGElement
)
22 , mSVGElement(aSVGElement
)
26 SVGAnimatedRect::~SVGAnimatedRect()
28 nsSVGViewBox::sSVGAnimatedRectTearoffTable
.RemoveTearoff(mVal
);
31 already_AddRefed
<SVGIRect
>
32 SVGAnimatedRect::GetBaseVal()
34 return mVal
->ToDOMBaseVal(mSVGElement
);
37 already_AddRefed
<SVGIRect
>
38 SVGAnimatedRect::GetAnimVal()
40 return mVal
->ToDOMAnimVal(mSVGElement
);
44 SVGAnimatedRect::WrapObject(JSContext
* aCx
)
46 return SVGAnimatedRectBinding::Wrap(aCx
, this);
50 } // namespace mozilla