Bug 833446: Remove nsIDOMSVGStyleElement r=peterv
authorDavid Zbarsky <dzbarsky@gmail.com>
Sat, 02 Feb 2013 15:23:19 -0500
changeset 130562 2e7305f65f73f42df7c2d389d1b45555e6c82dbd
parent 130561 8ea2ed91960524e46a4eeaa95ab70eda808de235
child 130563 83be9ac1f2ebc036d5ad5ce00db515fb3efeb29d
push id2323
push userbbajaj@mozilla.com
push dateMon, 01 Apr 2013 19:47:02 +0000
treeherdermozilla-beta@7712be144d91 [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 nsIDOMSVGStyleElement r=peterv
content/svg/content/src/SVGStyleElement.cpp
content/svg/content/src/SVGStyleElement.h
dom/base/nsDOMClassInfo.cpp
dom/base/nsDOMClassInfoClasses.h
dom/interfaces/svg/Makefile.in
dom/interfaces/svg/nsIDOMSVGStyleElement.idl
--- a/content/svg/content/src/SVGStyleElement.cpp
+++ b/content/svg/content/src/SVGStyleElement.cpp
@@ -4,18 +4,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/SVGStyleElement.h"
 #include "nsContentUtils.h"
 #include "nsStubMutationObserver.h"
 #include "mozilla/dom/SVGStyleElementBinding.h"
 
-DOMCI_NODE_DATA(SVGStyleElement, mozilla::dom::SVGStyleElement)
-
 NS_IMPL_NS_NEW_NAMESPACED_SVG_ELEMENT(Style)
 
 namespace mozilla {
 namespace dom {
 
 JSObject*
 SVGStyleElement::WrapNode(JSContext *aCx, JSObject *aScope, bool *aTriedToWrap)
 {
@@ -24,21 +22,20 @@ SVGStyleElement::WrapNode(JSContext *aCx
 
 //----------------------------------------------------------------------
 // nsISupports methods
 
 NS_IMPL_ADDREF_INHERITED(SVGStyleElement, SVGStyleElementBase)
 NS_IMPL_RELEASE_INHERITED(SVGStyleElement, SVGStyleElementBase)
 
 NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(SVGStyleElement)
-  NS_NODE_INTERFACE_TABLE7(SVGStyleElement, nsIDOMNode, nsIDOMElement,
-                           nsIDOMSVGElement, nsIDOMSVGStyleElement,
+  NS_NODE_INTERFACE_TABLE6(SVGStyleElement, nsIDOMNode, nsIDOMElement,
+                           nsIDOMSVGElement,
                            nsIDOMLinkStyle, nsIStyleSheetLinkingElement,
                            nsIMutationObserver)
-  NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGStyleElement)
 NS_INTERFACE_MAP_END_INHERITING(SVGStyleElementBase)
 
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(SVGStyleElement,
                                                   SVGStyleElementBase)
   tmp->nsStyleLinkElement::Traverse(cb);
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(SVGStyleElement,
                                                 SVGStyleElementBase)
@@ -189,66 +186,71 @@ void
 SVGStyleElement::ContentChanged(nsIContent* aContent)
 {
   if (nsContentUtils::IsInSameAnonymousTree(this, aContent)) {
     UpdateStyleSheetInternal(nullptr);
   }
 }
 
 //----------------------------------------------------------------------
-// nsIDOMSVGStyleElement methods
 
-/* attribute DOMString xmlspace; */
-NS_IMETHODIMP SVGStyleElement::GetXmlspace(nsAString & aXmlspace)
+void
+SVGStyleElement::GetXmlspace(nsAString & aXmlspace)
 {
   GetAttr(kNameSpaceID_XML, nsGkAtoms::space, aXmlspace);
+}
 
-  return NS_OK;
-}
-NS_IMETHODIMP SVGStyleElement::SetXmlspace(const nsAString & aXmlspace)
-{
-  return SetAttr(kNameSpaceID_XML, nsGkAtoms::space, aXmlspace, true);
-}
 void
 SVGStyleElement::SetXmlspace(const nsAString & aXmlspace, ErrorResult& rv)
 {
   rv = SetAttr(kNameSpaceID_XML, nsGkAtoms::space, aXmlspace, true);
 }
 
-/* attribute DOMString media; */
-NS_IMPL_STRING_ATTR(SVGStyleElement, Media, media)
+void
+SVGStyleElement::GetMedia(nsAString & aMedia)
+{
+  GetAttr(kNameSpaceID_None, nsGkAtoms::media, aMedia);
+}
+
 void
 SVGStyleElement::SetMedia(const nsAString& aMedia, ErrorResult& rv)
 {
   rv = SetAttr(kNameSpaceID_None, nsGkAtoms::media, aMedia, true);
 }
 
-/* attribute boolean scoped; */
-NS_IMPL_BOOL_ATTR(SVGStyleElement, Scoped, scoped)
 bool
 SVGStyleElement::Scoped() const
 {
   return GetBoolAttr(nsGkAtoms::scoped);
 }
+
 void
 SVGStyleElement::SetScoped(bool aScoped, ErrorResult& rv)
 {
   rv = SetBoolAttr(nsGkAtoms::scoped, aScoped);
 }
 
-/* attribute DOMString type; */
-NS_IMPL_STRING_ATTR(SVGStyleElement, Type, type)
+void
+SVGStyleElement::GetType(nsAString & aType)
+{
+  GetAttr(kNameSpaceID_None, nsGkAtoms::type, aType);
+}
+
 void
 SVGStyleElement::SetType(const nsAString& aType, ErrorResult& rv)
 {
   rv = SetAttr(kNameSpaceID_None, nsGkAtoms::type, aType, true);
 }
 
-/* attribute DOMString title; */
-NS_IMPL_STRING_ATTR(SVGStyleElement, Title, title)
+void
+SVGStyleElement::GetTitle(nsAString & aTitle)
+{
+  GetAttr(kNameSpaceID_None, nsGkAtoms::title, aTitle);
+}
+
 void
 SVGStyleElement::SetTitle(const nsAString& aTitle, ErrorResult& rv)
 {
   rv = SetAttr(kNameSpaceID_None, nsGkAtoms::title, aTitle, true);
 }
 
 //----------------------------------------------------------------------
 // nsStyleLinkElement methods
--- a/content/svg/content/src/SVGStyleElement.h
+++ b/content/svg/content/src/SVGStyleElement.h
@@ -2,43 +2,41 @@
 /* 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_SVGStyleElement_h
 #define mozilla_dom_SVGStyleElement_h
 
 #include "nsSVGElement.h"
-#include "nsIDOMSVGStyleElement.h"
 #include "nsStyleLinkElement.h"
 #include "nsStubMutationObserver.h"
 
 nsresult NS_NewSVGStyleElement(nsIContent **aResult,
                                already_AddRefed<nsINodeInfo> aNodeInfo);
 
 typedef nsSVGElement SVGStyleElementBase;
 
 namespace mozilla {
 namespace dom {
 
 class SVGStyleElement MOZ_FINAL : public SVGStyleElementBase,
-                                  public nsIDOMSVGStyleElement,
+                                  public nsIDOMSVGElement,
                                   public nsStyleLinkElement,
                                   public nsStubMutationObserver
 {
 protected:
   friend nsresult (::NS_NewSVGStyleElement(nsIContent **aResult,
                                            already_AddRefed<nsINodeInfo> aNodeInfo));
   SVGStyleElement(already_AddRefed<nsINodeInfo> aNodeInfo);
 
   virtual JSObject* WrapNode(JSContext *aCx, JSObject *aScope, bool *aTriedToWrap) MOZ_OVERRIDE;
 
 public:
   NS_DECL_ISUPPORTS_INHERITED
-  NS_DECL_NSIDOMSVGSTYLEELEMENT
 
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(SVGStyleElement,
                                            SVGStyleElementBase)
 
   // xxx I wish we could use virtual inheritance
   NS_FORWARD_NSIDOMNODE_TO_NSINODE
   NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
   NS_FORWARD_NSIDOMSVGELEMENT(SVGStyleElementBase::)
@@ -67,27 +65,29 @@ public:
   virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   // nsIMutationObserver
   NS_DECL_NSIMUTATIONOBSERVER_CHARACTERDATACHANGED
   NS_DECL_NSIMUTATIONOBSERVER_CONTENTAPPENDED
   NS_DECL_NSIMUTATIONOBSERVER_CONTENTINSERTED
   NS_DECL_NSIMUTATIONOBSERVER_CONTENTREMOVED
 
-  virtual nsXPCClassInfo* GetClassInfo();
-
   virtual nsIDOMNode* AsDOMNode() { return this; }
 
   // WebIDL
+  void GetXmlspace(nsAString & aXmlspace);
   void SetXmlspace(const nsAString & aXmlspace, ErrorResult& rv);
-  void SetType(const nsAString & aType, ErrorResult& rv);
-  void SetMedia(const nsAString & aMedia, ErrorResult& rv);
-  void SetTitle(const nsAString & aTitle, ErrorResult& rv);
+  void GetMedia(nsAString & aMedia);
+  void SetMedia(const nsAString& aMedia, ErrorResult& rv);
   bool Scoped() const;
   void SetScoped(bool aScoped, ErrorResult& rv);
+  void GetType(nsAString & aType);
+  void SetType(const nsAString& aType, ErrorResult& rv);
+  void GetTitle(nsAString & aTitle);
+  void SetTitle(const nsAString& aTitle, ErrorResult& rv);
 
 protected:
   // Dummy init method to make the NS_IMPL_NS_NEW_SVG_ELEMENT and
   // NS_IMPL_ELEMENT_CLONE_WITH_INIT usable with this class. This should be
   // completely optimized away.
   inline nsresult Init()
   {
     return NS_OK;
--- a/dom/base/nsDOMClassInfo.cpp
+++ b/dom/base/nsDOMClassInfo.cpp
@@ -324,17 +324,16 @@
 #include "nsIDOMSVGFilterElement.h"
 #include "nsIDOMSVGFilters.h"
 #include "nsIDOMSVGImageElement.h"
 #include "nsIDOMSVGLength.h"
 #include "nsIDOMSVGMarkerElement.h"
 #include "nsIDOMSVGMaskElement.h"
 #include "nsIDOMSVGNumber.h"
 #include "nsIDOMSVGRect.h"
-#include "nsIDOMSVGStyleElement.h"
 #include "nsIDOMSVGSVGElement.h"
 #include "nsIDOMSVGSwitchElement.h"
 #include "nsIDOMSVGSymbolElement.h"
 #include "nsIDOMSVGTextElement.h"
 #include "nsIDOMSVGTextPathElement.h"
 #include "nsIDOMSVGTitleElement.h"
 #include "nsIDOMSVGTSpanElement.h"
 #include "nsIDOMSVGUnitTypes.h"
@@ -1104,18 +1103,16 @@ static nsDOMClassInfoData sClassInfoData
   NS_DEFINE_CLASSINFO_DATA(SVGFilterElement, nsElementSH,
                            ELEMENT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(SVGImageElement, nsElementSH,
                            ELEMENT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(SVGMarkerElement, nsElementSH,
                            ELEMENT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(SVGMaskElement, nsElementSH,
                            ELEMENT_SCRIPTABLE_FLAGS)
-  NS_DEFINE_CLASSINFO_DATA(SVGStyleElement, nsElementSH,
-                           ELEMENT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(SVGSVGElement, nsElementSH,
                            ELEMENT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(SVGSwitchElement, nsElementSH,
                            ELEMENT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(SVGSymbolElement, nsElementSH,
                            ELEMENT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(SVGTextElement, nsElementSH,
                            ELEMENT_SCRIPTABLE_FLAGS)
@@ -3112,22 +3109,16 @@ nsDOMClassInfo::Init()
   DOM_CLASSINFO_MAP_END
 
   DOM_CLASSINFO_MAP_BEGIN(SVGMaskElement, nsIDOMSVGMaskElement)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGMaskElement)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGUnitTypes)
     DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
   DOM_CLASSINFO_MAP_END
 
-  DOM_CLASSINFO_MAP_BEGIN(SVGStyleElement, nsIDOMSVGStyleElement)
-    DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStyleElement)
-    DOM_CLASSINFO_MAP_ENTRY(nsIDOMLinkStyle)
-    DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
-  DOM_CLASSINFO_MAP_END
-
   DOM_CLASSINFO_MAP_BEGIN(SVGSVGElement, nsIDOMSVGSVGElement)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGSVGElement)
     DOM_CLASSINFO_SVG_GRAPHIC_ELEMENT_MAP_ENTRIES
   DOM_CLASSINFO_MAP_END
 
   DOM_CLASSINFO_MAP_BEGIN(SVGSwitchElement, nsIDOMSVGSwitchElement)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGSwitchElement)
     DOM_CLASSINFO_SVG_GRAPHIC_ELEMENT_MAP_ENTRIES
--- a/dom/base/nsDOMClassInfoClasses.h
+++ b/dom/base/nsDOMClassInfoClasses.h
@@ -217,17 +217,16 @@ DOMCI_CLASS(SVGFEPointLightElement)
 DOMCI_CLASS(SVGFESpecularLightingElement)
 DOMCI_CLASS(SVGFESpotLightElement)
 DOMCI_CLASS(SVGFETileElement)
 DOMCI_CLASS(SVGFETurbulenceElement)
 DOMCI_CLASS(SVGFilterElement)
 DOMCI_CLASS(SVGImageElement)
 DOMCI_CLASS(SVGMarkerElement)
 DOMCI_CLASS(SVGMaskElement)
-DOMCI_CLASS(SVGStyleElement)
 DOMCI_CLASS(SVGSVGElement)
 DOMCI_CLASS(SVGSwitchElement)
 DOMCI_CLASS(SVGSymbolElement)
 DOMCI_CLASS(SVGTextElement)
 DOMCI_CLASS(SVGTextPathElement)
 DOMCI_CLASS(SVGTitleElement)
 DOMCI_CLASS(SVGTSpanElement)
 DOMCI_CLASS(SVGUnknownElement)
--- a/dom/interfaces/svg/Makefile.in
+++ b/dom/interfaces/svg/Makefile.in
@@ -33,17 +33,16 @@ XPIDLSRCS	= \
 		nsIDOMSVGImageElement.idl \
 		nsIDOMSVGLength.idl \
 		nsIDOMSVGMarkerElement.idl \
 		nsIDOMSVGMaskElement.idl \
 		nsIDOMSVGNumber.idl \
 		nsIDOMSVGRect.idl \
 		nsIDOMSVGSVGElement.idl \
 		nsIDOMSVGStringList.idl \
-		nsIDOMSVGStyleElement.idl \
 		nsIDOMSVGSwitchElement.idl \
 		nsIDOMSVGSymbolElement.idl \
 		nsIDOMSVGTextContentElement.idl \
 		nsIDOMSVGTextElement.idl \
 		nsIDOMSVGTextPathElement.idl \
 		nsIDOMSVGTextPositionElem.idl \
 		nsIDOMSVGTitleElement.idl \
 		nsIDOMSVGTSpanElement.idl \
deleted file mode 100644
--- a/dom/interfaces/svg/nsIDOMSVGStyleElement.idl
+++ /dev/null
@@ -1,21 +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"
-
-[scriptable, uuid(2fecabb2-4671-4553-9e99-1b8167e3c131)]
-interface nsIDOMSVGStyleElement
-  : nsIDOMSVGElement
-{
-  attribute DOMString         xmlspace;
-                       // raises DOMException on setting
-  attribute DOMString         type;
-                       // raises DOMException on setting
-  attribute DOMString         media;
-                       // raises DOMException on setting
-  attribute DOMString         title;
-                       // raises DOMException on setting
-  attribute boolean           scoped;
-};