Bug 833446: Remove nsIDOMSVGAElement r=peterv
authorDavid Zbarsky <dzbarsky@gmail.com>
Mon, 18 Feb 2013 17:48:53 -0500
changeset 122269 0ea520af174ed4db1990c431620cf18c3bdc350d
parent 122268 beca555617478a690a8bc78e0a91bd7e10566764
child 122270 e20ec1200920fc1f8de7eaaf0e4fd1302d6f2503
push id24327
push usergszorc@mozilla.com
push dateTue, 19 Feb 2013 05:22:32 +0000
treeherdermozilla-central@e8f8a3f6f1f6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspeterv
bugs833446
milestone21.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 833446: Remove nsIDOMSVGAElement r=peterv
content/svg/content/src/SVGAElement.cpp
content/svg/content/src/SVGAElement.h
dom/base/nsDOMClassInfo.cpp
dom/base/nsDOMClassInfoClasses.h
dom/interfaces/svg/Makefile.in
dom/interfaces/svg/nsIDOMSVGAElement.idl
dom/webidl/SVGAElement.webidl
--- a/content/svg/content/src/SVGAElement.cpp
+++ b/content/svg/content/src/SVGAElement.cpp
@@ -2,26 +2,23 @@
 /* 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 "mozilla/dom/SVGAElement.h"
 #include "mozilla/dom/SVGAElementBinding.h"
-#include "nsIDOMSVGAElement.h"
 #include "nsIDOMSVGURIReference.h"
 #include "nsILink.h"
 #include "nsSVGString.h"
 #include "nsCOMPtr.h"
 #include "nsGkAtoms.h"
 #include "nsContentUtils.h"
 
-DOMCI_NODE_DATA(SVGAElement, mozilla::dom::SVGAElement)
-
 NS_IMPL_NS_NEW_NAMESPACED_SVG_ELEMENT(A)
 
 namespace mozilla {
 namespace dom {
 
 JSObject*
 SVGAElement::WrapNode(JSContext *aCx, JSObject *aScope, bool *aTriedToWrap)
 {
@@ -33,30 +30,23 @@ nsSVGElement::StringInfo SVGAElement::sS
   { &nsGkAtoms::href, kNameSpaceID_XLink, true },
   { &nsGkAtoms::target, kNameSpaceID_None, true }
 };
 
 
 //----------------------------------------------------------------------
 // nsISupports methods
 
-NS_IMPL_ADDREF_INHERITED(SVGAElement, SVGAElementBase)
-NS_IMPL_RELEASE_INHERITED(SVGAElement, SVGAElementBase)
-
-NS_INTERFACE_TABLE_HEAD(SVGAElement)
-  NS_NODE_INTERFACE_TABLE7(SVGAElement,
-                           nsIDOMNode,
-                           nsIDOMElement,
-                           nsIDOMSVGElement,
-                           nsIDOMSVGAElement,
-                           nsIDOMSVGURIReference,
-                           nsILink,
-                           Link)
-  NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGAElement)
-NS_INTERFACE_MAP_END_INHERITING(SVGAElementBase)
+NS_IMPL_ISUPPORTS_INHERITED6(SVGAElement, SVGAElementBase,
+                             nsIDOMNode,
+                             nsIDOMElement,
+                             nsIDOMSVGElement,
+                             nsIDOMSVGURIReference,
+                             nsILink,
+                             Link)
 
 
 //----------------------------------------------------------------------
 // Implementation
 
 SVGAElement::SVGAElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : SVGAElementBase(aNodeInfo),
     Link(this)
@@ -78,18 +68,16 @@ SVGAElement::GetHref(nsIDOMSVGAnimatedSt
 already_AddRefed<nsIDOMSVGAnimatedString>
 SVGAElement::Href()
 {
   nsCOMPtr<nsIDOMSVGAnimatedString> href;
   mStringAttributes[HREF].ToDOMAnimatedString(getter_AddRefs(href), this);
   return href.forget();
 }
 
-NS_IMPL_STRING_ATTR(SVGAElement, Download, download)
-
 //----------------------------------------------------------------------
 // nsINode methods
 
 nsresult
 SVGAElement::PreHandleEvent(nsEventChainPreVisitor& aVisitor)
 {
   nsresult rv = Element::PreHandleEvent(aVisitor);
   NS_ENSURE_SUCCESS(rv, rv);
@@ -102,35 +90,36 @@ SVGAElement::PostHandleEvent(nsEventChai
 {
   return PostHandleEventForLinks(aVisitor);
 }
 
 NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGAElement)
 
 
 //----------------------------------------------------------------------
-// nsIDOMSVGAElement methods
-
-/* readonly attribute nsIDOMSVGAnimatedString target; */
-NS_IMETHODIMP
-SVGAElement::GetTarget(nsIDOMSVGAnimatedString * *aTarget)
-{
-  *aTarget = Target().get();
-  return NS_OK;
-}
 
 already_AddRefed<nsIDOMSVGAnimatedString>
 SVGAElement::Target()
 {
   nsCOMPtr<nsIDOMSVGAnimatedString> target;
   mStringAttributes[TARGET].ToDOMAnimatedString(getter_AddRefs(target), this);
   return target.forget();
 }
 
+void
+SVGAElement::GetDownload(nsAString & aDownload)
+{
+  GetAttr(kNameSpaceID_None, nsGkAtoms::download, aDownload);
+}
 
+void
+SVGAElement::SetDownload(const nsAString & aDownload, ErrorResult& rv)
+{
+  rv = SetAttr(kNameSpaceID_None, nsGkAtoms::download, aDownload, true);
+}
 
 //----------------------------------------------------------------------
 // nsIContent methods
 
 nsresult
 SVGAElement::BindToTree(nsIDocument *aDocument, nsIContent *aParent,
                         nsIContent *aBindingParent,
                         bool aCompileEventHandlers)
--- a/content/svg/content/src/SVGAElement.h
+++ b/content/svg/content/src/SVGAElement.h
@@ -2,47 +2,45 @@
 /* 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_SVGAElement_h
 #define mozilla_dom_SVGAElement_h
 
 #include "Link.h"
-#include "nsIDOMSVGAElement.h"
 #include "nsIDOMSVGURIReference.h"
 #include "nsILink.h"
 #include "nsSVGString.h"
 #include "mozilla/dom/SVGGraphicsElement.h"
 
 nsresult NS_NewSVGAElement(nsIContent **aResult,
                            already_AddRefed<nsINodeInfo> aNodeInfo);
 
 namespace mozilla {
 namespace dom {
 
 typedef SVGGraphicsElement SVGAElementBase;
 
 class SVGAElement MOZ_FINAL : public SVGAElementBase,
-                              public nsIDOMSVGAElement,
+                              public nsIDOMSVGElement,
                               public nsIDOMSVGURIReference,
                               public nsILink,
                               public Link
 {
 protected:
   SVGAElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   friend nsresult (::NS_NewSVGAElement(nsIContent **aResult,
                                        already_AddRefed<nsINodeInfo> aNodeInfo));
   virtual JSObject* WrapNode(JSContext *cx, JSObject *scope, bool *triedToWrap) MOZ_OVERRIDE;
 
 public:
   // interfaces:
 
   NS_DECL_ISUPPORTS_INHERITED
-  NS_DECL_NSIDOMSVGAELEMENT
   NS_DECL_NSIDOMSVGURIREFERENCE
 
   // XXX: I wish we could use virtual inheritance
   NS_FORWARD_NSIDOMNODE_TO_NSINODE
   NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
   NS_FORWARD_NSIDOMSVGELEMENT(SVGAElementBase::)
 
   // nsINode interface methods
@@ -73,23 +71,23 @@ public:
     return SetAttr(aNameSpaceID, aName, nullptr, aValue, aNotify);
   }
   virtual nsresult SetAttr(int32_t aNameSpaceID, nsIAtom* aName,
                            nsIAtom* aPrefix, const nsAString& aValue,
                            bool aNotify);
   virtual nsresult UnsetAttr(int32_t aNameSpaceID, nsIAtom* aAttribute,
                              bool aNotify);
 
-  virtual nsXPCClassInfo* GetClassInfo();
-
   virtual nsIDOMNode* AsDOMNode() { return this; }
 
   // WebIDL
   already_AddRefed<nsIDOMSVGAnimatedString> Href();
   already_AddRefed<nsIDOMSVGAnimatedString> Target();
+  void GetDownload(nsAString & aDownload);
+  void SetDownload(const nsAString & aDownload, ErrorResult& rv);
 
 protected:
 
   virtual StringAttributesInfo GetStringInfo();
 
   enum { HREF, TARGET };
   nsSVGString mStringAttributes[2];
   static StringInfo sStringInfo[2];
--- a/dom/base/nsDOMClassInfo.cpp
+++ b/dom/base/nsDOMClassInfo.cpp
@@ -304,17 +304,16 @@
 #endif
 #include "nsIDOMXPathExpression.h"
 #include "nsIDOMNSXPathExpression.h"
 #include "nsIDOMXPathNSResolver.h"
 #include "nsIDOMXPathResult.h"
 #include "nsIDOMMozBrowserFrame.h"
 
 #include "nsIDOMGetSVGDocument.h"
-#include "nsIDOMSVGAElement.h"
 #include "nsIDOMSVGAnimatedEnum.h"
 #include "nsIDOMSVGAnimatedInteger.h"
 #include "nsIDOMSVGAnimatedLength.h"
 #include "nsIDOMSVGAnimatedNumber.h"
 #include "nsIDOMSVGAnimatedRect.h"
 #include "nsIDOMSVGAnimatedString.h"
 #include "nsIDOMTimeEvent.h"
 #include "nsIDOMSVGDocument.h"
@@ -1014,18 +1013,16 @@ static nsDOMClassInfoData sClassInfoData
   NS_DEFINE_CLASSINFO_DATA(BeforeUnloadEvent, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
 
   // SVG document
   NS_DEFINE_CLASSINFO_DATA(SVGDocument, nsDocumentSH,
                            DOCUMENT_SCRIPTABLE_FLAGS)
 
   // SVG element classes
-  NS_DEFINE_CLASSINFO_DATA(SVGAElement, nsElementSH,
-                           ELEMENT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(TimeEvent, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(SVGFEBlendElement, nsElementSH,
                            ELEMENT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(SVGFEColorMatrixElement, nsElementSH,
                            ELEMENT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(SVGFEComponentTransferElement, nsElementSH,
                            ELEMENT_SCRIPTABLE_FLAGS)
@@ -2851,23 +2848,16 @@ nsDOMClassInfo::Init()
     // Order is significant.  nsIDOMDocument.title shadows
     // nsIDOMSVGDocument.title, which is readonly.
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMDocument)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGDocument)
     DOM_CLASSINFO_DOCUMENT_MAP_ENTRIES
   DOM_CLASSINFO_MAP_END
 
   // SVG element classes
-
-  DOM_CLASSINFO_MAP_BEGIN(SVGAElement, nsIDOMSVGAElement)
-    DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGAElement)
-    DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGURIReference)
-    DOM_CLASSINFO_SVG_GRAPHIC_ELEMENT_MAP_ENTRIES
-  DOM_CLASSINFO_MAP_END
-
   DOM_CLASSINFO_MAP_BEGIN(TimeEvent, nsIDOMTimeEvent)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMTimeEvent)
     DOM_CLASSINFO_EVENT_MAP_ENTRIES
   DOM_CLASSINFO_MAP_END
 
   DOM_CLASSINFO_MAP_BEGIN(SVGFEBlendElement, nsIDOMSVGFEBlendElement)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFEBlendElement)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFilterPrimitiveStandardAttributes)
--- a/dom/base/nsDOMClassInfoClasses.h
+++ b/dom/base/nsDOMClassInfoClasses.h
@@ -188,17 +188,16 @@ DOMCI_CLASS(CSSMozDocumentRule)
 DOMCI_CLASS(CSSSupportsRule)
 
 DOMCI_CLASS(BeforeUnloadEvent)
 
 // The SVG document
 DOMCI_CLASS(SVGDocument)
 
 // SVG element classes
-DOMCI_CLASS(SVGAElement)
 DOMCI_CLASS(TimeEvent)
 DOMCI_CLASS(SVGFEBlendElement)
 DOMCI_CLASS(SVGFEColorMatrixElement)
 DOMCI_CLASS(SVGFEComponentTransferElement)
 DOMCI_CLASS(SVGFECompositeElement)
 DOMCI_CLASS(SVGFEConvolveMatrixElement)
 DOMCI_CLASS(SVGFEDiffuseLightingElement)
 DOMCI_CLASS(SVGFEDisplacementMapElement)
--- a/dom/interfaces/svg/Makefile.in
+++ b/dom/interfaces/svg/Makefile.in
@@ -12,17 +12,16 @@ VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE		= dom
 XPIDL_MODULE	= dom_svg
 
 XPIDLSRCS	= \
 		nsIDOMGetSVGDocument.idl \
-		nsIDOMSVGAElement.idl \
 		nsIDOMSVGAnimatedEnum.idl \
 		nsIDOMSVGAnimatedInteger.idl \
 		nsIDOMSVGAnimatedLength.idl \
 		nsIDOMSVGAnimatedNumber.idl \
 		nsIDOMSVGAnimatedRect.idl \
 		nsIDOMSVGAnimatedString.idl \
 		nsIDOMSVGDocument.idl \
 		nsIDOMSVGElement.idl \
deleted file mode 100644
--- a/dom/interfaces/svg/nsIDOMSVGAElement.idl
+++ /dev/null
@@ -1,37 +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 "nsIDOMSVGElement.idl"
-
-/**
- * For more information on this interface please see
- * http://www.w3.org/TR/SVG/linking.html#AElement
- */
-
-interface nsIDOMSVGAnimatedString;
-
-[scriptable, uuid(6e0eff6e-ce35-4c01-ab3c-ae81b79b40ca)]
-interface nsIDOMSVGAElement
-  : nsIDOMSVGElement
-/*
-  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,
-    nsIDOMSVGTests,
-    nsIDOMSVGLangSpace,
-    nsIDOMSVGExternalResourcesRequired,
-    nsIDOMSVGStylable,
-    nsIDOMSVGTransformable,
-    events::nsIDOMEventTarget
-*/
-{
-  readonly attribute nsIDOMSVGAnimatedString target;
-  attribute DOMString download;
-};
--- a/dom/webidl/SVGAElement.webidl
+++ b/dom/webidl/SVGAElement.webidl
@@ -9,12 +9,15 @@
  * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
  * liability, trademark and document use rules apply.
  */
 
 interface SVGAnimatedString;
 
 interface SVGAElement : SVGGraphicsElement {
   readonly attribute SVGAnimatedString target;
+
+  [SetterThrows]
+  attribute DOMString download;
 };
 
 SVGAElement implements SVGURIReference;