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 virtual nsresult
ValueFromString(
40 const nsAString
& aStr
, const dom::SVGAnimationElement
* aSrcElement
,
41 SMILValue
& aValue
, bool& aPreventCachingOfSandwich
) const override
;
42 virtual SMILValue
GetBaseValue() const override
;
43 virtual nsresult
SetAnimValue(const SMILValue
& aValue
) override
;
44 virtual void ClearAnimValue() override
;
45 virtual const nsIContent
* GetTargetNode() const override
;
48 // Raw pointers are OK here because this SVGMotionSMILAttr is both
49 // created & destroyed during a SMIL sample-step, during which time the DOM
51 dom::SVGElement
* mSVGElement
;
54 } // namespace mozilla
56 #endif // DOM_SVG_SVGMOTIONSMILATTR_H_