Bug 1882593 [wpt PR 44836] - Add test for unknown, invalid ancillary chunk which...
[gecko.git] / dom / svg / SVGMotionSMILAttr.h
blob953aeed5b0cbe97a7d10164020ecf3a9fe2ac1d6
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"
15 class nsIContent;
17 namespace mozilla {
19 class SMILValue;
21 namespace dom {
22 class SVGAnimationElement;
23 class SVGElement;
24 } // namespace dom
26 /**
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 {
34 public:
35 explicit SVGMotionSMILAttr(dom::SVGElement* aSVGElement)
36 : mSVGElement(aSVGElement) {}
38 // SMILAttr methods
39 nsresult ValueFromString(const nsAString& aStr,
40 const dom::SVGAnimationElement* aSrcElement,
41 SMILValue& aValue,
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;
48 protected:
49 // Raw pointers are OK here because this SVGMotionSMILAttr is both
50 // created & destroyed during a SMIL sample-step, during which time the DOM
51 // isn't modified.
52 dom::SVGElement* mSVGElement;
55 } // namespace mozilla
57 #endif // DOM_SVG_SVGMOTIONSMILATTR_H_