Bug 825147: Convert SVGDefsElement to WebIDL r=bz

--HG--
rename : content/svg/content/src/nsSVGDefsElement.cpp => content/svg/content/src/SVGDefsElement.cpp
rename : content/svg/content/src/nsSVGDefsElement.cpp => content/svg/content/src/SVGDefsElement.h
This commit is contained in:
David Zbarsky 2013-01-06 01:25:54 -05:00
Родитель a0f1e93cf3
Коммит 866a8a4d20
6 изменённых файлов: 144 добавлений и 102 удалений

Просмотреть файл

@ -44,7 +44,6 @@ CPPSRCS = \
nsSVGClass.cpp \ nsSVGClass.cpp \
nsSVGClipPathElement.cpp \ nsSVGClipPathElement.cpp \
nsSVGDataParser.cpp \ nsSVGDataParser.cpp \
nsSVGDefsElement.cpp \
nsSVGElement.cpp \ nsSVGElement.cpp \
nsSVGElementFactory.cpp \ nsSVGElementFactory.cpp \
nsSVGEllipseElement.cpp \ nsSVGEllipseElement.cpp \
@ -116,6 +115,7 @@ CPPSRCS = \
nsSVGSetElement.cpp \ nsSVGSetElement.cpp \
SVGAttrValueWrapper.cpp \ SVGAttrValueWrapper.cpp \
SVGContentUtils.cpp \ SVGContentUtils.cpp \
SVGDefsElement.cpp \
SVGDescElement.cpp \ SVGDescElement.cpp \
SVGIntegerPairSMILType.cpp \ SVGIntegerPairSMILType.cpp \
SVGLengthListSMILType.cpp \ SVGLengthListSMILType.cpp \
@ -156,6 +156,7 @@ EXPORTS_mozilla/dom = \
SVGAngle.h \ SVGAngle.h \
SVGAnimatedAngle.h \ SVGAnimatedAngle.h \
SVGAnimatedBoolean.h \ SVGAnimatedBoolean.h \
SVGDefsElement.h \
SVGDescElement.h \ SVGDescElement.h \
SVGGraphicsElement.h \ SVGGraphicsElement.h \
SVGLocatableElement.h \ SVGLocatableElement.h \

Просмотреть файл

@ -0,0 +1,74 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "mozilla/dom/SVGDefsElement.h"
#include "mozilla/dom/SVGDefsElementBinding.h"
DOMCI_NODE_DATA(SVGDefsElement, mozilla::dom::SVGDefsElement)
NS_IMPL_NS_NEW_NAMESPACED_SVG_ELEMENT(Defs)
namespace mozilla {
namespace dom {
JSObject*
SVGDefsElement::WrapNode(JSContext *aCx, JSObject *aScope, bool *aTriedToWrap)
{
return SVGDefsElementBinding::Wrap(aCx, aScope, this, aTriedToWrap);
}
//----------------------------------------------------------------------
// nsISupports methods
NS_IMPL_ADDREF_INHERITED(SVGDefsElement, SVGGraphicsElement)
NS_IMPL_RELEASE_INHERITED(SVGDefsElement, SVGGraphicsElement)
NS_INTERFACE_TABLE_HEAD(SVGDefsElement)
NS_NODE_INTERFACE_TABLE4(SVGDefsElement, nsIDOMNode, nsIDOMElement,
nsIDOMSVGElement,
nsIDOMSVGDefsElement)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGDefsElement)
NS_INTERFACE_MAP_END_INHERITING(SVGGraphicsElement)
//----------------------------------------------------------------------
// Implementation
SVGDefsElement::SVGDefsElement(already_AddRefed<nsINodeInfo> aNodeInfo)
: SVGGraphicsElement(aNodeInfo)
{
SetIsDOMBinding();
}
//----------------------------------------------------------------------
// nsIDOMNode methods
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGDefsElement)
//----------------------------------------------------------------------
// nsIContent methods
NS_IMETHODIMP_(bool)
SVGDefsElement::IsAttributeMapped(const nsIAtom* name) const
{
static const MappedAttributeEntry* const map[] = {
sFEFloodMap,
sFiltersMap,
sFontSpecificationMap,
sGradientStopMap,
sLightingEffectsMap,
sMarkersMap,
sTextContentElementsMap,
sViewportsMap
};
return FindAttributeDependence(name, map) ||
SVGGraphicsElement::IsAttributeMapped(name);
}
} // namespace dom
} // namespace mozilla

Просмотреть файл

@ -0,0 +1,52 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef mozilla_dom_SVGDefsElement_h
#define mozilla_dom_SVGDefsElement_h
#include "mozilla/Util.h"
#include "SVGGraphicsElement.h"
#include "nsIDOMSVGDefsElement.h"
nsresult NS_NewSVGDefsElement(nsIContent **aResult,
already_AddRefed<nsINodeInfo> aNodeInfo);
namespace mozilla {
namespace dom {
class SVGDefsElement MOZ_FINAL : public SVGGraphicsElement,
public nsIDOMSVGDefsElement
{
protected:
friend nsresult (::NS_NewSVGDefsElement(nsIContent **aResult,
already_AddRefed<nsINodeInfo> aNodeInfo));
SVGDefsElement(already_AddRefed<nsINodeInfo> aNodeInfo);
virtual JSObject* WrapNode(JSContext *cx, JSObject *scope, bool *triedToWrap) MOZ_OVERRIDE;
public:
// interfaces:
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIDOMSVGDEFSELEMENT
// xxx I wish we could use virtual inheritance
NS_FORWARD_NSIDOMNODE_TO_NSINODE
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
NS_FORWARD_NSIDOMSVGELEMENT(SVGGraphicsElement::)
// nsIContent
NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const;
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
virtual nsXPCClassInfo* GetClassInfo();
virtual nsIDOMNode* AsDOMNode() { return this; }
};
} // namespace dom
} // namespace mozilla
#endif // mozilla_dom_SVGDefsElement_h

Просмотреть файл

@ -1,101 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "mozilla/Util.h"
#include "SVGGraphicsElement.h"
#include "nsIDOMSVGDefsElement.h"
using namespace mozilla;
typedef mozilla::dom::SVGGraphicsElement nsSVGDefsElementBase;
class nsSVGDefsElement : public nsSVGDefsElementBase,
public nsIDOMSVGDefsElement
{
protected:
friend nsresult NS_NewSVGDefsElement(nsIContent **aResult,
already_AddRefed<nsINodeInfo> aNodeInfo);
nsSVGDefsElement(already_AddRefed<nsINodeInfo> aNodeInfo);
public:
// interfaces:
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIDOMSVGDEFSELEMENT
// xxx I wish we could use virtual inheritance
NS_FORWARD_NSIDOMNODE_TO_NSINODE
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGDefsElementBase::)
// nsIContent
NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const;
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
virtual nsXPCClassInfo* GetClassInfo();
virtual nsIDOMNode* AsDOMNode() { return this; }
};
////////////////////////////////////////////////////////////////////////
// implementation
NS_IMPL_NS_NEW_SVG_ELEMENT(Defs)
//----------------------------------------------------------------------
// nsISupports methods
NS_IMPL_ADDREF_INHERITED(nsSVGDefsElement,nsSVGDefsElementBase)
NS_IMPL_RELEASE_INHERITED(nsSVGDefsElement,nsSVGDefsElementBase)
DOMCI_NODE_DATA(SVGDefsElement, nsSVGDefsElement)
NS_INTERFACE_TABLE_HEAD(nsSVGDefsElement)
NS_NODE_INTERFACE_TABLE4(nsSVGDefsElement, nsIDOMNode, nsIDOMElement,
nsIDOMSVGElement,
nsIDOMSVGDefsElement)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGDefsElement)
NS_INTERFACE_MAP_END_INHERITING(nsSVGDefsElementBase)
//----------------------------------------------------------------------
// Implementation
nsSVGDefsElement::nsSVGDefsElement(already_AddRefed<nsINodeInfo> aNodeInfo)
: nsSVGDefsElementBase(aNodeInfo)
{
}
//----------------------------------------------------------------------
// nsIDOMNode methods
NS_IMPL_ELEMENT_CLONE_WITH_INIT(nsSVGDefsElement)
//----------------------------------------------------------------------
// nsIContent methods
NS_IMETHODIMP_(bool)
nsSVGDefsElement::IsAttributeMapped(const nsIAtom* name) const
{
static const MappedAttributeEntry* const map[] = {
sFEFloodMap,
sFiltersMap,
sFontSpecificationMap,
sGradientStopMap,
sLightingEffectsMap,
sMarkersMap,
sTextContentElementsMap,
sViewportsMap
};
return FindAttributeDependence(name, map) ||
nsSVGDefsElementBase::IsAttributeMapped(name);
}

Просмотреть файл

@ -0,0 +1,15 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
*
* The origin of this IDL file is
* http://www.w3.org/TR/SVG2/
*
* Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
* liability, trademark and document use rules apply.
*/
interface SVGDefsElement : SVGGraphicsElement {
};

Просмотреть файл

@ -103,6 +103,7 @@ webidl_files = \
SVGAnimatedNumberList.webidl \ SVGAnimatedNumberList.webidl \
SVGAnimatedPreserveAspectRatio.webidl \ SVGAnimatedPreserveAspectRatio.webidl \
SVGAnimatedTransformList.webidl \ SVGAnimatedTransformList.webidl \
SVGDefsElement.webidl \
SVGDescElement.webidl \ SVGDescElement.webidl \
SVGElement.webidl \ SVGElement.webidl \
SVGGraphicsElement.webidl \ SVGGraphicsElement.webidl \