Bug 1805294 [wpt PR 37463] - WebKit export of https://bugs.webkit.org/show_bug.cgi...
[gecko.git] / dom / svg / DOMSVGAnimatedLength.h
blob09df1d0ce470c519af8ebc5cf14c4e6e63661a64
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_DOMSVGANIMATEDLENGTH_H_
8 #define DOM_SVG_DOMSVGANIMATEDLENGTH_H_
10 #include "mozilla/Attributes.h"
11 #include "SVGElement.h"
13 namespace mozilla {
15 class SVGAnimatedLength;
17 namespace dom {
19 class DOMSVGLength;
21 class DOMSVGAnimatedLength final : public nsWrapperCache {
22 public:
23 NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(DOMSVGAnimatedLength)
24 NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(DOMSVGAnimatedLength)
26 DOMSVGAnimatedLength(SVGAnimatedLength* aVal, SVGElement* aSVGElement)
27 : mVal(aVal), mSVGElement(aSVGElement) {}
29 // WebIDL
30 SVGElement* GetParentObject() { return mSVGElement; }
31 JSObject* WrapObject(JSContext* aCx,
32 JS::Handle<JSObject*> aGivenProto) override;
33 already_AddRefed<DOMSVGLength> BaseVal();
34 already_AddRefed<DOMSVGLength> AnimVal();
36 protected:
37 ~DOMSVGAnimatedLength();
39 SVGAnimatedLength* mVal; // kept alive because it belongs to content
40 RefPtr<SVGElement> mSVGElement;
43 } // namespace dom
44 } // namespace mozilla
46 #endif // DOM_SVG_DOMSVGANIMATEDLENGTH_H_