Bug 824327: Convert SVGDescElement to WebIDL r=bz

--HG--
rename : content/svg/content/src/nsSVGDescElement.cpp => content/svg/content/src/SVGDescElement.cpp
rename : content/svg/content/src/nsSVGDescElement.cpp => content/svg/content/src/SVGDescElement.h
This commit is contained in:
David Zbarsky 2013-01-04 17:28:05 -05:00
Родитель fad4a3787c
Коммит b3c0addb84
6 изменённых файлов: 120 добавлений и 77 удалений

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

@ -45,7 +45,6 @@ CPPSRCS = \
nsSVGClipPathElement.cpp \
nsSVGDataParser.cpp \
nsSVGDefsElement.cpp \
nsSVGDescElement.cpp \
nsSVGElement.cpp \
nsSVGElementFactory.cpp \
nsSVGEllipseElement.cpp \
@ -122,6 +121,7 @@ CPPSRCS = \
nsSVGSetElement.cpp \
SVGAttrValueWrapper.cpp \
SVGContentUtils.cpp \
SVGDescElement.cpp \
SVGIntegerPairSMILType.cpp \
SVGLengthListSMILType.cpp \
SVGMotionSMILType.cpp \
@ -154,6 +154,7 @@ EXPORTS_mozilla/dom = \
SVGAngle.h \
SVGAnimatedAngle.h \
SVGAnimatedBoolean.h \
SVGDescElement.h \
$(NULL)
include $(topsrcdir)/config/rules.mk

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

@ -0,0 +1,50 @@
/* -*- 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/SVGDescElement.h"
#include "mozilla/dom/SVGDescElementBinding.h"
DOMCI_NODE_DATA(SVGDescElement, mozilla::dom::SVGDescElement)
NS_IMPL_NS_NEW_NAMESPACED_SVG_ELEMENT(Desc)
namespace mozilla {
namespace dom {
JSObject*
SVGDescElement::WrapNode(JSContext *aCx, JSObject *aScope, bool *aTriedToWrap)
{
return SVGDescElementBinding::Wrap(aCx, aScope, this, aTriedToWrap);
}
//----------------------------------------------------------------------
// nsISupports methods
NS_IMPL_ADDREF_INHERITED(SVGDescElement, SVGDescElementBase)
NS_IMPL_RELEASE_INHERITED(SVGDescElement, SVGDescElementBase)
NS_INTERFACE_TABLE_HEAD(SVGDescElement)
NS_NODE_INTERFACE_TABLE4(SVGDescElement, nsIDOMNode, nsIDOMElement,
nsIDOMSVGElement, nsIDOMSVGDescElement)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGDescElement)
NS_INTERFACE_MAP_END_INHERITING(SVGDescElementBase)
//----------------------------------------------------------------------
// Implementation
SVGDescElement::SVGDescElement(already_AddRefed<nsINodeInfo> aNodeInfo)
: SVGDescElementBase(aNodeInfo)
{
SetIsDOMBinding();
}
//----------------------------------------------------------------------
// nsIDOMNode methods
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGDescElement)
} // 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_SVGDescElement_h
#define mozilla_dom_SVGDescElement_h
#include "nsSVGElement.h"
#include "nsIDOMSVGDescElement.h"
nsresult NS_NewSVGDescElement(nsIContent **aResult,
already_AddRefed<nsINodeInfo> aNodeInfo);
typedef nsSVGElement SVGDescElementBase;
namespace mozilla {
namespace dom {
class SVGDescElement MOZ_FINAL : public SVGDescElementBase,
public nsIDOMSVGDescElement
{
protected:
friend nsresult (::NS_NewSVGDescElement(nsIContent **aResult,
already_AddRefed<nsINodeInfo> aNodeInfo));
SVGDescElement(already_AddRefed<nsINodeInfo> aNodeInfo);
virtual JSObject* WrapNode(JSContext *aCx, JSObject *aScope, bool *aTriedToWrap) MOZ_OVERRIDE;
public:
// interfaces:
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIDOMSVGDESCELEMENT
// xxx I wish we could use virtual inheritance
NS_FORWARD_NSIDOMNODE_TO_NSINODE
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
NS_FORWARD_NSIDOMSVGELEMENT(SVGDescElementBase::)
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
virtual nsXPCClassInfo* GetClassInfo();
virtual nsIDOMNode* AsDOMNode() { return this; }
};
} // namespace dom
} // namespace mozilla
#endif // mozilla_dom_SVGDescElement_h

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

@ -1,76 +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 "nsSVGElement.h"
#include "nsIDOMSVGDescElement.h"
typedef nsSVGElement nsSVGDescElementBase;
class nsSVGDescElement : public nsSVGDescElementBase,
public nsIDOMSVGDescElement
{
protected:
friend nsresult NS_NewSVGDescElement(nsIContent **aResult,
already_AddRefed<nsINodeInfo> aNodeInfo);
nsSVGDescElement(already_AddRefed<nsINodeInfo> aNodeInfo);
nsresult Init();
public:
// interfaces:
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIDOMSVGDESCELEMENT
// xxx I wish we could use virtual inheritance
NS_FORWARD_NSIDOMNODE_TO_NSINODE
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGDescElementBase::)
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
virtual nsXPCClassInfo* GetClassInfo();
virtual nsIDOMNode* AsDOMNode() { return this; }
};
NS_IMPL_NS_NEW_SVG_ELEMENT(Desc)
//----------------------------------------------------------------------
// nsISupports methods
NS_IMPL_ADDREF_INHERITED(nsSVGDescElement, nsSVGDescElementBase)
NS_IMPL_RELEASE_INHERITED(nsSVGDescElement, nsSVGDescElementBase)
DOMCI_NODE_DATA(SVGDescElement, nsSVGDescElement)
NS_INTERFACE_TABLE_HEAD(nsSVGDescElement)
NS_NODE_INTERFACE_TABLE4(nsSVGDescElement, nsIDOMNode, nsIDOMElement,
nsIDOMSVGElement, nsIDOMSVGDescElement)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGDescElement)
NS_INTERFACE_MAP_END_INHERITING(nsSVGDescElementBase)
//----------------------------------------------------------------------
// Implementation
nsSVGDescElement::nsSVGDescElement(already_AddRefed<nsINodeInfo> aNodeInfo)
: nsSVGDescElementBase(aNodeInfo)
{
}
nsresult
nsSVGDescElement::Init()
{
return nsSVGDescElementBase::Init();
}
//----------------------------------------------------------------------
// nsIDOMNode methods
NS_IMPL_ELEMENT_CLONE_WITH_INIT(nsSVGDescElement)

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

@ -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 SVGDescElement : SVGElement {
};

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

@ -96,6 +96,7 @@ webidl_files = \
SVGAnimatedNumberList.webidl \
SVGAnimatedPreserveAspectRatio.webidl \
SVGAnimatedTransformList.webidl \
SVGDescElement.webidl \
SVGElement.webidl \
SVGLengthList.webidl \
SVGMatrix.webidl \