Bumping manifests a=b2g-bump
[gecko.git] / dom / svg / SVGSymbolElement.cpp
blob2ee49e76800542e5cae6120ef34ef3f881c8c2d5
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)
11 namespace mozilla {
12 namespace dom {
14 JSObject*
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 //----------------------------------------------------------------------
28 // Implementation
30 SVGSymbolElement::SVGSymbolElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
31 : SVGSymbolElementBase(aNodeInfo)
35 SVGSymbolElement::~SVGSymbolElement()
39 //----------------------------------------------------------------------
40 // nsIDOMNode methods
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 //----------------------------------------------------------------------
61 // nsIContent methods
63 NS_IMETHODIMP_(bool)
64 SVGSymbolElement::IsAttributeMapped(const nsIAtom* name) const
66 static const MappedAttributeEntry* const map[] = {
67 sColorMap,
68 sFEFloodMap,
69 sFillStrokeMap,
70 sFiltersMap,
71 sFontSpecificationMap,
72 sGradientStopMap,
73 sGraphicsMap,
74 sLightingEffectsMap,
75 sMarkersMap,
76 sTextContentElementsMap,
77 sViewportsMap
80 return FindAttributeDependence(name, map) ||
81 SVGSymbolElementBase::IsAttributeMapped(name);
84 //----------------------------------------------------------------------
85 // nsSVGElement methods
87 nsSVGViewBox *
88 SVGSymbolElement::GetViewBox()
90 return &mViewBox;
93 SVGAnimatedPreserveAspectRatio *
94 SVGSymbolElement::GetPreserveAspectRatio()
96 return &mPreserveAspectRatio;
99 } // namespace dom
100 } // namespace mozilla