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 #include "SVGMotionSMILAttr.h"
10 #include "SVGMotionSMILType.h"
11 #include "mozilla/dom/SVGAnimationElement.h"
12 #include "nsSMILValue.h"
14 #include "nsSVGElement.h"
15 #include "gfx2DGlue.h"
20 SVGMotionSMILAttr::ValueFromString(const nsAString
& aStr
,
21 const dom::SVGAnimationElement
* aSrcElement
,
23 bool& aPreventCachingOfSandwich
) const
25 NS_NOTREACHED("Shouldn't using nsISMILAttr::ValueFromString for parsing "
26 "animateMotion's SMIL values.");
27 return NS_ERROR_FAILURE
;
31 SVGMotionSMILAttr::GetBaseValue() const
33 return nsSMILValue(&SVGMotionSMILType::sSingleton
);
37 SVGMotionSMILAttr::ClearAnimValue()
39 mSVGElement
->SetAnimateMotionTransform(nullptr);
43 SVGMotionSMILAttr::SetAnimValue(const nsSMILValue
& aValue
)
45 gfx::Matrix matrix
= SVGMotionSMILType::CreateMatrix(aValue
);
46 mSVGElement
->SetAnimateMotionTransform(&matrix
);
51 SVGMotionSMILAttr::GetTargetNode() const
56 } // namespace mozilla