Bug 1700051: part 46) Const-qualify `mozInlineSpellStatus::mAnchorRange`. r=smaug
[gecko.git] / dom / svg / SVGMotionSMILAttr.cpp
blobc269e876afa4d3f2c17201d261a5f8eba6079934
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"
15 #include "nsDebug.h"
16 #include "gfx2DGlue.h"
18 namespace mozilla {
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);
40 return NS_OK;
43 const nsIContent* SVGMotionSMILAttr::GetTargetNode() const {
44 return mSVGElement;
47 } // namespace mozilla