Coverage Report

Created: 2018-09-25 14:53

/src/mozilla-central/dom/svg/SVGAnimateTransformElement.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
#include "mozilla/dom/SVGAnimateTransformElement.h"
8
#include "mozilla/dom/SVGAnimateTransformElementBinding.h"
9
10
NS_IMPL_NS_NEW_NAMESPACED_SVG_ELEMENT(AnimateTransform)
11
12
namespace mozilla {
13
namespace dom {
14
15
JSObject*
16
SVGAnimateTransformElement::WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto)
17
0
{
18
0
  return SVGAnimateTransformElement_Binding::Wrap(aCx, this, aGivenProto);
19
0
}
20
21
//----------------------------------------------------------------------
22
// Implementation
23
24
SVGAnimateTransformElement::SVGAnimateTransformElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
25
  : SVGAnimationElement(std::move(aNodeInfo))
26
0
{
27
0
}
28
29
bool
30
SVGAnimateTransformElement::ParseAttribute(int32_t aNamespaceID,
31
                                           nsAtom* aAttribute,
32
                                           const nsAString& aValue,
33
                                           nsIPrincipal* aMaybeScriptedPrincipal,
34
                                           nsAttrValue& aResult)
35
0
{
36
0
  // 'type' is an <animateTransform>-specific attribute, and we'll handle it
37
0
  // specially.
38
0
  if (aNamespaceID == kNameSpaceID_None && aAttribute == nsGkAtoms::type) {
39
0
    aResult.ParseAtom(aValue);
40
0
    nsAtom* atom = aResult.GetAtomValue();
41
0
    if (atom != nsGkAtoms::translate &&
42
0
        atom != nsGkAtoms::scale &&
43
0
        atom != nsGkAtoms::rotate &&
44
0
        atom != nsGkAtoms::skewX &&
45
0
        atom != nsGkAtoms::skewY) {
46
0
      ReportAttributeParseFailure(OwnerDoc(), aAttribute, aValue);
47
0
    }
48
0
    return true;
49
0
  }
50
0
51
0
  return SVGAnimationElement::ParseAttribute(aNamespaceID,
52
0
                                             aAttribute, aValue,
53
0
                                             aMaybeScriptedPrincipal,
54
0
                                             aResult);
55
0
}
56
57
//----------------------------------------------------------------------
58
// nsINode methods
59
60
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGAnimateTransformElement)
61
62
//----------------------------------------------------------------------
63
64
nsSMILAnimationFunction&
65
SVGAnimateTransformElement::AnimationFunction()
66
0
{
67
0
  return mAnimationFunction;
68
0
}
69
70
} // namespace dom
71
} // namespace mozilla
72