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 #ifndef DOM_SVG_SVGANIMATEDRECT_H_
8 #define DOM_SVG_SVGANIMATEDRECT_H_
10 #include "nsCycleCollectionParticipant.h"
11 #include "mozilla/dom/SVGElement.h"
12 #include "mozilla/Attributes.h"
13 #include "mozilla/ErrorResult.h"
14 #include "nsWrapperCache.h"
18 class SVGAnimatedViewBox
;
24 // Despite the name of this class appearing to be generic,
25 // SVGAnimatedRect is only used for viewBox attributes.
27 class SVGAnimatedRect final
: public nsWrapperCache
{
29 NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(SVGAnimatedRect
)
30 NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(SVGAnimatedRect
)
32 SVGAnimatedRect(SVGAnimatedViewBox
* aVal
, SVGElement
* aSVGElement
);
34 SVGElement
* GetParentObject() const { return mSVGElement
; }
36 virtual JSObject
* WrapObject(JSContext
* aCx
,
37 JS::Handle
<JSObject
*> aGivenProto
) override
;
39 already_AddRefed
<SVGRect
> GetBaseVal();
41 already_AddRefed
<SVGRect
> GetAnimVal();
44 virtual ~SVGAnimatedRect();
46 SVGAnimatedViewBox
* mVal
; // kept alive because it belongs to content
47 RefPtr
<SVGElement
> mSVGElement
;
51 } // namespace mozilla
53 #endif // DOM_SVG_SVGANIMATEDRECT_H_