/src/mozilla-central/dom/svg/SVGMotionSMILAttr.cpp
Line | Count | Source (jump to first uncovered line) |
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/. */ |
6 | | |
7 | | /* representation of a dummy attribute targeted by <animateMotion> element */ |
8 | | |
9 | | #include "SVGMotionSMILAttr.h" |
10 | | #include "SVGMotionSMILType.h" |
11 | | #include "mozilla/dom/SVGAnimationElement.h" |
12 | | #include "nsSMILValue.h" |
13 | | #include "nsDebug.h" |
14 | | #include "nsSVGElement.h" |
15 | | #include "gfx2DGlue.h" |
16 | | |
17 | | namespace mozilla { |
18 | | |
19 | | nsresult |
20 | | SVGMotionSMILAttr::ValueFromString(const nsAString& aStr, |
21 | | const dom::SVGAnimationElement* aSrcElement, |
22 | | nsSMILValue& aValue, |
23 | | bool& aPreventCachingOfSandwich) const |
24 | 0 | { |
25 | 0 | MOZ_ASSERT_UNREACHABLE("Shouldn't using nsISMILAttr::ValueFromString for " |
26 | 0 | "parsing animateMotion's SMIL values."); |
27 | 0 | return NS_ERROR_FAILURE; |
28 | 0 | } |
29 | | |
30 | | nsSMILValue |
31 | | SVGMotionSMILAttr::GetBaseValue() const |
32 | 0 | { |
33 | 0 | return nsSMILValue(&SVGMotionSMILType::sSingleton); |
34 | 0 | } |
35 | | |
36 | | void |
37 | | SVGMotionSMILAttr::ClearAnimValue() |
38 | 0 | { |
39 | 0 | mSVGElement->SetAnimateMotionTransform(nullptr); |
40 | 0 | } |
41 | | |
42 | | nsresult |
43 | | SVGMotionSMILAttr::SetAnimValue(const nsSMILValue& aValue) |
44 | 0 | { |
45 | 0 | gfx::Matrix matrix = SVGMotionSMILType::CreateMatrix(aValue); |
46 | 0 | mSVGElement->SetAnimateMotionTransform(&matrix); |
47 | 0 | return NS_OK; |
48 | 0 | } |
49 | | |
50 | | const nsIContent* |
51 | | SVGMotionSMILAttr::GetTargetNode() const |
52 | 0 | { |
53 | 0 | return mSVGElement; |
54 | 0 | } |
55 | | |
56 | | } // namespace mozilla |