1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include "mozilla/dom/SVGSymbolElement.h"
7 #include "mozilla/dom/SVGSymbolElementBinding.h"
9 NS_IMPL_NS_NEW_NAMESPACED_SVG_ELEMENT(Symbol
)
15 SVGSymbolElement::WrapNode(JSContext
*aCx
)
17 return SVGSymbolElementBinding::Wrap(aCx
, this);
20 //----------------------------------------------------------------------
21 // nsISupports methods
23 NS_IMPL_ISUPPORTS_INHERITED(SVGSymbolElement
, SVGSymbolElementBase
,
24 nsIDOMNode
, nsIDOMElement
,
25 nsIDOMSVGElement
, mozilla::dom::SVGTests
)
27 //----------------------------------------------------------------------
30 SVGSymbolElement::SVGSymbolElement(already_AddRefed
<mozilla::dom::NodeInfo
>& aNodeInfo
)
31 : SVGSymbolElementBase(aNodeInfo
)
35 SVGSymbolElement::~SVGSymbolElement()
39 //----------------------------------------------------------------------
42 NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGSymbolElement
)
44 //----------------------------------------------------------------------
46 already_AddRefed
<SVGAnimatedRect
>
47 SVGSymbolElement::ViewBox()
49 return mViewBox
.ToSVGAnimatedRect(this);
52 already_AddRefed
<DOMSVGAnimatedPreserveAspectRatio
>
53 SVGSymbolElement::PreserveAspectRatio()
55 nsRefPtr
<DOMSVGAnimatedPreserveAspectRatio
> ratio
;
56 mPreserveAspectRatio
.ToDOMAnimatedPreserveAspectRatio(getter_AddRefs(ratio
), this);
57 return ratio
.forget();
60 //----------------------------------------------------------------------
64 SVGSymbolElement::IsAttributeMapped(const nsIAtom
* name
) const
66 static const MappedAttributeEntry
* const map
[] = {
71 sFontSpecificationMap
,
76 sTextContentElementsMap
,
80 return FindAttributeDependence(name
, map
) ||
81 SVGSymbolElementBase::IsAttributeMapped(name
);
84 //----------------------------------------------------------------------
85 // nsSVGElement methods
88 SVGSymbolElement::GetViewBox()
93 SVGAnimatedPreserveAspectRatio
*
94 SVGSymbolElement::GetPreserveAspectRatio()
96 return &mPreserveAspectRatio
;
100 } // namespace mozilla