2015-05-03 22:32:37 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2010-04-29 03:00:54 +04:00
|
|
|
|
|
|
|
/* representation of a dummy attribute targeted by <animateMotion> element */
|
|
|
|
|
|
|
|
#ifndef MOZILLA_SVGMOTIONSMILATTR_H_
|
|
|
|
#define MOZILLA_SVGMOTIONSMILATTR_H_
|
|
|
|
|
2013-05-30 00:43:41 +04:00
|
|
|
#include "mozilla/Attributes.h"
|
2010-04-29 03:00:54 +04:00
|
|
|
#include "nsISMILAttr.h"
|
2012-01-26 13:57:21 +04:00
|
|
|
|
|
|
|
class nsIContent;
|
|
|
|
class nsSMILValue;
|
2010-04-29 03:00:54 +04:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
|
2013-03-19 07:18:45 +04:00
|
|
|
namespace dom {
|
|
|
|
class SVGAnimationElement;
|
2018-12-21 11:58:14 +03:00
|
|
|
class SVGElement;
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace dom
|
2013-03-19 07:18:45 +04:00
|
|
|
|
2010-04-29 03:00:54 +04:00
|
|
|
/**
|
|
|
|
* SVGMotionSMILAttr: Implements the nsISMILAttr interface for SMIL animations
|
|
|
|
* from <animateMotion>.
|
|
|
|
*
|
|
|
|
* NOTE: Even though there's technically no "motion" attribute, we behave in
|
|
|
|
* many ways as if there were, for simplicity.
|
|
|
|
*/
|
|
|
|
class SVGMotionSMILAttr : public nsISMILAttr {
|
|
|
|
public:
|
2018-12-21 11:58:14 +03:00
|
|
|
explicit SVGMotionSMILAttr(dom::SVGElement* aSVGElement)
|
2010-04-29 03:00:54 +04:00
|
|
|
: mSVGElement(aSVGElement) {}
|
|
|
|
|
|
|
|
// nsISMILAttr methods
|
|
|
|
virtual nsresult ValueFromString(
|
2013-03-19 07:18:45 +04:00
|
|
|
const nsAString& aStr, const dom::SVGAnimationElement* aSrcElement,
|
2015-03-21 19:28:04 +03:00
|
|
|
nsSMILValue& aValue, bool& aPreventCachingOfSandwich) const override;
|
|
|
|
virtual nsSMILValue GetBaseValue() const override;
|
|
|
|
virtual nsresult SetAnimValue(const nsSMILValue& aValue) override;
|
|
|
|
virtual void ClearAnimValue() override;
|
|
|
|
virtual const nsIContent* GetTargetNode() const override;
|
2010-04-29 03:00:54 +04:00
|
|
|
|
|
|
|
protected:
|
|
|
|
// Raw pointers are OK here because this SVGMotionSMILAttr is both
|
|
|
|
// created & destroyed during a SMIL sample-step, during which time the DOM
|
|
|
|
// isn't modified.
|
2018-12-21 11:58:14 +03:00
|
|
|
dom::SVGElement* mSVGElement;
|
2010-04-29 03:00:54 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // MOZILLA_SVGMOTIONSMILATTR_H_
|