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"
11 #include "mozilla/dom/SVGAnimationElement.h"
12 #include "mozilla/dom/SVGElement.h"
13 #include "mozilla/SMILValue.h"
14 #include "SVGMotionSMILType.h"
16 #include "gfx2DGlue.h"
20 nsresult
SVGMotionSMILAttr::ValueFromString(
21 const nsAString
& aStr
, const dom::SVGAnimationElement
* aSrcElement
,
22 SMILValue
& aValue
, bool& aPreventCachingOfSandwich
) const {
23 MOZ_ASSERT_UNREACHABLE(
24 "Shouldn't using SMILAttr::ValueFromString for "
25 "parsing animateMotion's SMIL values.");
26 return NS_ERROR_FAILURE
;
29 SMILValue
SVGMotionSMILAttr::GetBaseValue() const {
30 return SMILValue(&SVGMotionSMILType::sSingleton
);
33 void SVGMotionSMILAttr::ClearAnimValue() {
34 mSVGElement
->SetAnimateMotionTransform(nullptr);
37 nsresult
SVGMotionSMILAttr::SetAnimValue(const SMILValue
& aValue
) {
38 gfx::Matrix matrix
= SVGMotionSMILType::CreateMatrix(aValue
);
39 mSVGElement
->SetAnimateMotionTransform(&matrix
);
43 const nsIContent
* SVGMotionSMILAttr::GetTargetNode() const {
47 } // namespace mozilla