Bug 1936278 - Prevent search mode chiclet from being dismissed when clicking in page...
[gecko.git] / dom / svg / SVGAnimateTransformElement.cpp
blobb9d5628149eb65b6806a8536f7fd52ae297f8ba4
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 #include "mozilla/dom/SVGAnimateTransformElement.h"
8 #include "mozilla/dom/SVGAnimateTransformElementBinding.h"
10 NS_IMPL_NS_NEW_SVG_ELEMENT(AnimateTransform)
12 namespace mozilla::dom {
14 JSObject* SVGAnimateTransformElement::WrapNode(
15 JSContext* aCx, JS::Handle<JSObject*> aGivenProto) {
16 return SVGAnimateTransformElement_Binding::Wrap(aCx, this, aGivenProto);
19 //----------------------------------------------------------------------
20 // Implementation
22 SVGAnimateTransformElement::SVGAnimateTransformElement(
23 already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
24 : SVGAnimationElement(std::move(aNodeInfo)) {}
26 bool SVGAnimateTransformElement::ParseAttribute(
27 int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue,
28 nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) {
29 // 'type' is an <animateTransform>-specific attribute, and we'll handle it
30 // specially.
31 if (aNamespaceID == kNameSpaceID_None && aAttribute == nsGkAtoms::type) {
32 aResult.ParseAtom(aValue);
33 nsAtom* atom = aResult.GetAtomValue();
34 if (atom != nsGkAtoms::translate && atom != nsGkAtoms::scale &&
35 atom != nsGkAtoms::rotate && atom != nsGkAtoms::skewX &&
36 atom != nsGkAtoms::skewY) {
37 ReportAttributeParseFailure(OwnerDoc(), aAttribute, aValue);
39 return true;
42 return SVGAnimationElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
43 aMaybeScriptedPrincipal, aResult);
46 //----------------------------------------------------------------------
47 // nsINode methods
49 NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGAnimateTransformElement)
51 //----------------------------------------------------------------------
53 SMILAnimationFunction& SVGAnimateTransformElement::AnimationFunction() {
54 return mAnimationFunction;
57 } // namespace mozilla::dom