1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #include "SVGAnimatedRect.h"
8 #include "mozilla/dom/SVGAnimatedRectBinding.h"
9 #include "mozilla/dom/SVGElement.h"
10 #include "mozilla/dom/SVGRect.h"
11 #include "SVGAnimatedViewBox.h"
13 namespace mozilla::dom
{
15 NS_SVG_VAL_IMPL_CYCLE_COLLECTION_WRAPPERCACHED(SVGAnimatedRect
, mSVGElement
)
17 SVGAnimatedRect::SVGAnimatedRect(SVGAnimatedViewBox
* aVal
,
18 SVGElement
* aSVGElement
)
19 : mVal(aVal
), mSVGElement(aSVGElement
) {}
21 SVGAnimatedRect::~SVGAnimatedRect() {
22 SVGAnimatedViewBox::sSVGAnimatedRectTearoffTable
.RemoveTearoff(mVal
);
25 already_AddRefed
<SVGRect
> SVGAnimatedRect::GetBaseVal() {
26 return mVal
->ToDOMBaseVal(mSVGElement
);
29 already_AddRefed
<SVGRect
> SVGAnimatedRect::GetAnimVal() {
30 return mVal
->ToDOMAnimVal(mSVGElement
);
33 JSObject
* SVGAnimatedRect::WrapObject(JSContext
* aCx
,
34 JS::Handle
<JSObject
*> aGivenProto
) {
35 return SVGAnimatedRect_Binding::Wrap(aCx
, this, aGivenProto
);
38 } // namespace mozilla::dom