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 /* representation of a dummy attribute targeted by <animateMotion> element */
9 #ifndef DOM_SVG_SVGMOTIONSMILATTR_H_
10 #define DOM_SVG_SVGMOTIONSMILATTR_H_
12 #include "mozilla/Attributes.h"
13 #include "mozilla/SMILAttr.h"
22 class SVGAnimationElement
;
27 * SVGMotionSMILAttr: Implements the SMILAttr interface for SMIL animations
28 * from <animateMotion>.
30 * NOTE: Even though there's technically no "motion" attribute, we behave in
31 * many ways as if there were, for simplicity.
33 class SVGMotionSMILAttr
: public SMILAttr
{
35 explicit SVGMotionSMILAttr(dom::SVGElement
* aSVGElement
)
36 : mSVGElement(aSVGElement
) {}
39 nsresult
ValueFromString(const nsAString
& aStr
,
40 const dom::SVGAnimationElement
* aSrcElement
,
42 bool& aPreventCachingOfSandwich
) const override
;
43 SMILValue
GetBaseValue() const override
;
44 nsresult
SetAnimValue(const SMILValue
& aValue
) override
;
45 void ClearAnimValue() override
;
46 const nsIContent
* GetTargetNode() const override
;
49 // Raw pointers are OK here because this SVGMotionSMILAttr is both
50 // created & destroyed during a SMIL sample-step, during which time the DOM
52 dom::SVGElement
* mSVGElement
;
55 } // namespace mozilla
57 #endif // DOM_SVG_SVGMOTIONSMILATTR_H_