From 353c1d24c5a3f3b6f8592f821f93cdb1fd18d029 Mon Sep 17 00:00:00 2001 From: David Zbarsky Date: Sat, 2 Feb 2013 15:22:36 -0500 Subject: [PATCH] Bug 833446: Remove nsIDOMSVGAltGlyphElement r=peterv --- .../svg/content/src/SVGAltGlyphElement.cpp | 44 +++++++------------ content/svg/content/src/SVGAltGlyphElement.h | 11 ++--- dom/base/nsDOMClassInfo.cpp | 9 ---- dom/base/nsDOMClassInfoClasses.h | 1 - dom/interfaces/svg/Makefile.in | 1 - .../svg/nsIDOMSVGAltGlyphElement.idl | 25 ----------- dom/webidl/SVGAltGlyphElement.webidl | 2 + 7 files changed, 24 insertions(+), 69 deletions(-) delete mode 100644 dom/interfaces/svg/nsIDOMSVGAltGlyphElement.idl diff --git a/content/svg/content/src/SVGAltGlyphElement.cpp b/content/svg/content/src/SVGAltGlyphElement.cpp index 96133fc0a07a..7abb63d701ea 100644 --- a/content/svg/content/src/SVGAltGlyphElement.cpp +++ b/content/svg/content/src/SVGAltGlyphElement.cpp @@ -7,8 +7,6 @@ #include "mozilla/dom/SVGAltGlyphElementBinding.h" #include "nsContentUtils.h" -DOMCI_NODE_DATA(SVGAltGlyphElement, mozilla::dom::SVGAltGlyphElement) - NS_IMPL_NS_NEW_NAMESPACED_SVG_ELEMENT(AltGlyph) namespace mozilla { @@ -29,16 +27,12 @@ nsSVGElement::StringInfo SVGAltGlyphElement::sStringInfo[1] = //---------------------------------------------------------------------- // nsISupports methods -NS_IMPL_ADDREF_INHERITED(SVGAltGlyphElement,SVGAltGlyphElementBase) -NS_IMPL_RELEASE_INHERITED(SVGAltGlyphElement,SVGAltGlyphElementBase) - -NS_INTERFACE_TABLE_HEAD(SVGAltGlyphElement) - NS_NODE_INTERFACE_TABLE7(SVGAltGlyphElement, nsIDOMNode, nsIDOMElement, - nsIDOMSVGElement, nsIDOMSVGAltGlyphElement, - nsIDOMSVGTextPositioningElement, nsIDOMSVGTextContentElement, - nsIDOMSVGURIReference) - NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGAltGlyphElement) -NS_INTERFACE_MAP_END_INHERITING(SVGAltGlyphElementBase) +NS_IMPL_ISUPPORTS_INHERITED6(SVGAltGlyphElement, SVGAltGlyphElementBase, + nsIDOMNode, nsIDOMElement, + nsIDOMSVGElement, + nsIDOMSVGTextPositioningElement, + nsIDOMSVGTextContentElement, + nsIDOMSVGURIReference) //---------------------------------------------------------------------- // Implementation @@ -49,7 +43,6 @@ SVGAltGlyphElement::SVGAltGlyphElement(already_AddRefed aNodeInfo) SetIsDOMBinding(); } - //---------------------------------------------------------------------- // nsIDOMNode methods @@ -73,33 +66,28 @@ SVGAltGlyphElement::Href() return href.forget(); } -//---------------------------------------------------------------------- -// nsIDOMSVGAltGlyphElement methods - -/* attribute DOMString glyphRef; */ -NS_IMETHODIMP SVGAltGlyphElement::GetGlyphRef(nsAString & aGlyphRef) +void +SVGAltGlyphElement::GetGlyphRef(nsAString & aGlyphRef) { GetAttr(kNameSpaceID_None, nsGkAtoms::glyphRef, aGlyphRef); - - return NS_OK; } -NS_IMETHODIMP SVGAltGlyphElement::SetGlyphRef(const nsAString & aGlyphRef) +void +SVGAltGlyphElement::SetGlyphRef(const nsAString & aGlyphRef, ErrorResult& rv) { - return SetAttr(kNameSpaceID_None, nsGkAtoms::glyphRef, aGlyphRef, true); + rv = SetAttr(kNameSpaceID_None, nsGkAtoms::glyphRef, aGlyphRef, true); } -/* attribute DOMString format; */ -NS_IMETHODIMP SVGAltGlyphElement::GetFormat(nsAString & aFormat) +void +SVGAltGlyphElement::GetFormat(nsAString & aFormat) { GetAttr(kNameSpaceID_None, nsGkAtoms::format, aFormat); - - return NS_OK; } -NS_IMETHODIMP SVGAltGlyphElement::SetFormat(const nsAString & aFormat) +void +SVGAltGlyphElement::SetFormat(const nsAString & aFormat, ErrorResult& rv) { - return SetAttr(kNameSpaceID_None, nsGkAtoms::format, aFormat, true); + rv = SetAttr(kNameSpaceID_None, nsGkAtoms::format, aFormat, true); } //---------------------------------------------------------------------- diff --git a/content/svg/content/src/SVGAltGlyphElement.h b/content/svg/content/src/SVGAltGlyphElement.h index e4a21d75a54d..05578adbbd1d 100644 --- a/content/svg/content/src/SVGAltGlyphElement.h +++ b/content/svg/content/src/SVGAltGlyphElement.h @@ -6,10 +6,10 @@ #ifndef mozilla_dom_SVGAltGlyphElement_h #define mozilla_dom_SVGAltGlyphElement_h -#include "nsIDOMSVGAltGlyphElement.h" #include "nsIDOMSVGURIReference.h" #include "mozilla/dom/SVGTextPositioningElement.h" #include "nsSVGString.h" +#include "nsIDOMSVGTextPositionElem.h" nsresult NS_NewSVGAltGlyphElement(nsIContent **aResult, already_AddRefed aNodeInfo); @@ -20,7 +20,7 @@ namespace dom { typedef SVGTextPositioningElement SVGAltGlyphElementBase; class SVGAltGlyphElement MOZ_FINAL : public SVGAltGlyphElementBase, // = nsIDOMSVGTextPositioningElement - public nsIDOMSVGAltGlyphElement, + public nsIDOMSVGTextPositioningElement, public nsIDOMSVGURIReference { protected: @@ -33,7 +33,6 @@ public: // interfaces: NS_DECL_ISUPPORTS_INHERITED - NS_DECL_NSIDOMSVGALTGLYPHELEMENT NS_DECL_NSIDOMSVGURIREFERENCE // xxx If xpcom allowed virtual inheritance we wouldn't need to @@ -49,12 +48,14 @@ public: virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const; - virtual nsXPCClassInfo* GetClassInfo(); - virtual nsIDOMNode* AsDOMNode() { return this; } // WebIDL already_AddRefed Href(); + void GetGlyphRef(nsAString & aGlyphRef); + void SetGlyphRef(const nsAString & aGlyphRef, ErrorResult& rv); + void GetFormat(nsAString & aFormat); + void SetFormat(const nsAString & aFormat, ErrorResult& rv); protected: diff --git a/dom/base/nsDOMClassInfo.cpp b/dom/base/nsDOMClassInfo.cpp index b0cdc05a539f..d9715ae5ae0f 100644 --- a/dom/base/nsDOMClassInfo.cpp +++ b/dom/base/nsDOMClassInfo.cpp @@ -310,7 +310,6 @@ #include "nsIDOMGetSVGDocument.h" #include "nsIDOMSVGAElement.h" -#include "nsIDOMSVGAltGlyphElement.h" #include "nsIDOMSVGAnimatedEnum.h" #include "nsIDOMSVGAnimatedInteger.h" #include "nsIDOMSVGAnimatedLength.h" @@ -1073,8 +1072,6 @@ static nsDOMClassInfoData sClassInfoData[] = { // SVG element classes NS_DEFINE_CLASSINFO_DATA(SVGAElement, nsElementSH, ELEMENT_SCRIPTABLE_FLAGS) - NS_DEFINE_CLASSINFO_DATA(SVGAltGlyphElement, nsElementSH, - ELEMENT_SCRIPTABLE_FLAGS) NS_DEFINE_CLASSINFO_DATA(SVGAnimateElement, nsElementSH, ELEMENT_SCRIPTABLE_FLAGS) NS_DEFINE_CLASSINFO_DATA(SVGAnimateTransformElement, nsElementSH, @@ -3015,12 +3012,6 @@ nsDOMClassInfo::Init() DOM_CLASSINFO_SVG_GRAPHIC_ELEMENT_MAP_ENTRIES DOM_CLASSINFO_MAP_END - DOM_CLASSINFO_MAP_BEGIN(SVGAltGlyphElement, nsIDOMSVGAltGlyphElement) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGTextPositioningElement) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGURIReference) - DOM_CLASSINFO_SVG_TEXT_CONTENT_ELEMENT_MAP_ENTRIES - DOM_CLASSINFO_MAP_END - DOM_CLASSINFO_MAP_BEGIN(SVGAnimateElement, nsIDOMSVGAnimateElement) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGAnimationElement) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGAnimateElement) diff --git a/dom/base/nsDOMClassInfoClasses.h b/dom/base/nsDOMClassInfoClasses.h index e841ee0efc3b..2e7b9cdf3554 100644 --- a/dom/base/nsDOMClassInfoClasses.h +++ b/dom/base/nsDOMClassInfoClasses.h @@ -192,7 +192,6 @@ DOMCI_CLASS(SVGDocument) // SVG element classes DOMCI_CLASS(SVGAElement) -DOMCI_CLASS(SVGAltGlyphElement) DOMCI_CLASS(SVGAnimateElement) DOMCI_CLASS(SVGAnimateTransformElement) DOMCI_CLASS(SVGAnimateMotionElement) diff --git a/dom/interfaces/svg/Makefile.in b/dom/interfaces/svg/Makefile.in index cf25cab71922..7f650cbab4c7 100644 --- a/dom/interfaces/svg/Makefile.in +++ b/dom/interfaces/svg/Makefile.in @@ -18,7 +18,6 @@ XPIDL_MODULE = dom_svg XPIDLSRCS = \ nsIDOMGetSVGDocument.idl \ nsIDOMSVGAElement.idl \ - nsIDOMSVGAltGlyphElement.idl \ nsIDOMSVGAnimatedEnum.idl \ nsIDOMSVGAnimatedInteger.idl \ nsIDOMSVGAnimatedLength.idl \ diff --git a/dom/interfaces/svg/nsIDOMSVGAltGlyphElement.idl b/dom/interfaces/svg/nsIDOMSVGAltGlyphElement.idl deleted file mode 100644 index b4f0565c1961..000000000000 --- a/dom/interfaces/svg/nsIDOMSVGAltGlyphElement.idl +++ /dev/null @@ -1,25 +0,0 @@ -/* -*- 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/. */ - -#include "nsIDOMSVGTextPositionElem.idl" - -[scriptable, uuid(D7274F91-0FC7-42F1-AD56-3C58AF2B0113)] -interface nsIDOMSVGAltGlyphElement : nsIDOMSVGTextPositioningElement -/* - The SVG DOM makes use of multiple interface inheritance. - Since XPCOM only supports single interface inheritance, - the best thing that we can do is to promise that whenever - an object implements _this_ interface it will also - implement the following interfaces. (We then have to QI to - hop between them.) - - nsIDOMSVGURIReference -*/ -{ - attribute DOMString glyphRef; - // raises DOMException on setting - attribute DOMString format; - // raises DOMException on setting -}; diff --git a/dom/webidl/SVGAltGlyphElement.webidl b/dom/webidl/SVGAltGlyphElement.webidl index 80e8ab066aba..7df015c6db12 100644 --- a/dom/webidl/SVGAltGlyphElement.webidl +++ b/dom/webidl/SVGAltGlyphElement.webidl @@ -11,7 +11,9 @@ */ interface SVGAltGlyphElement : SVGTextPositioningElement { + [SetterThrows] attribute DOMString glyphRef; + [SetterThrows] attribute DOMString format; };