diff --git a/content/svg/content/src/SVGScriptElement.cpp b/content/svg/content/src/SVGScriptElement.cpp index 632757ebce9d..f8965503021d 100644 --- a/content/svg/content/src/SVGScriptElement.cpp +++ b/content/svg/content/src/SVGScriptElement.cpp @@ -10,8 +10,6 @@ #include "mozilla/dom/SVGScriptElement.h" #include "mozilla/dom/SVGScriptElementBinding.h" -DOMCI_NODE_DATA(SVGScriptElement, mozilla::dom::SVGScriptElement) - NS_IMPL_NS_NEW_NAMESPACED_SVG_ELEMENT_CHECK_PARSER(Script) namespace mozilla { @@ -31,16 +29,11 @@ nsSVGElement::StringInfo SVGScriptElement::sStringInfo[1] = //---------------------------------------------------------------------- // nsISupports methods -NS_IMPL_ADDREF_INHERITED(SVGScriptElement,SVGScriptElementBase) -NS_IMPL_RELEASE_INHERITED(SVGScriptElement,SVGScriptElementBase) - -NS_INTERFACE_TABLE_HEAD(SVGScriptElement) - NS_NODE_INTERFACE_TABLE8(SVGScriptElement, nsIDOMNode, nsIDOMElement, - nsIDOMSVGElement, nsIDOMSVGScriptElement, - nsIDOMSVGURIReference, nsIScriptLoaderObserver, - nsIScriptElement, nsIMutationObserver) - NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGScriptElement) -NS_INTERFACE_MAP_END_INHERITING(SVGScriptElementBase) +NS_IMPL_ISUPPORTS_INHERITED7(SVGScriptElement, SVGScriptElementBase, + nsIDOMNode, nsIDOMElement, + nsIDOMSVGElement, + nsIDOMSVGURIReference, nsIScriptLoaderObserver, + nsIScriptElement, nsIMutationObserver) //---------------------------------------------------------------------- // Implementation @@ -82,12 +75,29 @@ SVGScriptElement::Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const } //---------------------------------------------------------------------- -// nsIDOMSVGScriptElement methods +void +SVGScriptElement::GetType(nsAString & aType) +{ + GetAttr(kNameSpaceID_None, nsGkAtoms::type, aType); +} -/* attribute DOMString type; */ -NS_IMPL_STRING_ATTR(SVGScriptElement, Type, type) -/* attribute DOMString crossOrigin */ -NS_IMPL_STRING_ATTR(SVGScriptElement, CrossOrigin, crossorigin) +void +SVGScriptElement::SetType(const nsAString & aType, ErrorResult& rv) +{ + rv = SetAttr(kNameSpaceID_None, nsGkAtoms::type, aType, true); +} + +void +SVGScriptElement::GetCrossOrigin(nsAString & aOrigin) +{ + GetAttr(kNameSpaceID_None, nsGkAtoms::crossorigin, aOrigin); +} + +void +SVGScriptElement::SetCrossOrigin(const nsAString & aOrigin, ErrorResult& rv) +{ + rv = SetAttr(kNameSpaceID_None, nsGkAtoms::crossorigin, aOrigin, true); +} //---------------------------------------------------------------------- // nsIDOMSVGURIReference methods diff --git a/content/svg/content/src/SVGScriptElement.h b/content/svg/content/src/SVGScriptElement.h index 7ee852ba184a..7086f2e042ee 100644 --- a/content/svg/content/src/SVGScriptElement.h +++ b/content/svg/content/src/SVGScriptElement.h @@ -8,7 +8,6 @@ #define mozilla_dom_SVGScriptElement_h #include "nsSVGElement.h" -#include "nsIDOMSVGScriptElement.h" #include "nsIDOMSVGURIReference.h" #include "nsCOMPtr.h" #include "nsSVGString.h" @@ -25,7 +24,7 @@ namespace dom { typedef nsSVGElement SVGScriptElementBase; class SVGScriptElement MOZ_FINAL : public SVGScriptElementBase, - public nsIDOMSVGScriptElement, + public nsIDOMSVGElement, public nsIDOMSVGURIReference, public nsScriptElement { @@ -42,7 +41,6 @@ public: // interfaces: NS_DECL_ISUPPORTS_INHERITED - NS_DECL_NSIDOMSVGSCRIPTELEMENT NS_DECL_NSIDOMSVGURIREFERENCE // xxx If xpcom allowed virtual inheritance we wouldn't need to @@ -57,7 +55,7 @@ public: virtual void GetScriptCharset(nsAString& charset); virtual void FreezeUriAsyncDefer(); virtual CORSMode GetCORSMode() const; - + // nsScriptElement virtual bool HasScriptContent(); @@ -74,11 +72,13 @@ public: virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const; - virtual nsXPCClassInfo* GetClassInfo(); - virtual nsIDOMNode* AsDOMNode() { return this; } // WebIDL + void GetType(nsAString & aType); + void SetType(const nsAString & aType, ErrorResult& rv); + void GetCrossOrigin(nsAString & aOrigin); + void SetCrossOrigin(const nsAString & aOrigin, ErrorResult& rv); already_AddRefed Href(); protected: diff --git a/dom/base/nsDOMClassInfo.cpp b/dom/base/nsDOMClassInfo.cpp index d7748272009b..c0d85bb124de 100644 --- a/dom/base/nsDOMClassInfo.cpp +++ b/dom/base/nsDOMClassInfo.cpp @@ -329,7 +329,6 @@ #include "nsIDOMSVGMaskElement.h" #include "nsIDOMSVGNumber.h" #include "nsIDOMSVGRect.h" -#include "nsIDOMSVGScriptElement.h" #include "nsIDOMSVGStopElement.h" #include "nsIDOMSVGStyleElement.h" #include "nsIDOMSVGSVGElement.h" @@ -1111,8 +1110,6 @@ static nsDOMClassInfoData sClassInfoData[] = { ELEMENT_SCRIPTABLE_FLAGS) NS_DEFINE_CLASSINFO_DATA(SVGMaskElement, nsElementSH, ELEMENT_SCRIPTABLE_FLAGS) - NS_DEFINE_CLASSINFO_DATA(SVGScriptElement, nsElementSH, - ELEMENT_SCRIPTABLE_FLAGS) NS_DEFINE_CLASSINFO_DATA(SVGStopElement, nsElementSH, ELEMENT_SCRIPTABLE_FLAGS) NS_DEFINE_CLASSINFO_DATA(SVGStyleElement, nsElementSH, @@ -3123,12 +3120,6 @@ nsDOMClassInfo::Init() DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES DOM_CLASSINFO_MAP_END - DOM_CLASSINFO_MAP_BEGIN(SVGScriptElement, nsIDOMSVGScriptElement) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGScriptElement) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGURIReference) - DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES - DOM_CLASSINFO_MAP_END - DOM_CLASSINFO_MAP_BEGIN(SVGStopElement, nsIDOMSVGStopElement) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStopElement) DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES diff --git a/dom/base/nsDOMClassInfoClasses.h b/dom/base/nsDOMClassInfoClasses.h index 38465370a43d..01725afb055a 100644 --- a/dom/base/nsDOMClassInfoClasses.h +++ b/dom/base/nsDOMClassInfoClasses.h @@ -222,7 +222,6 @@ DOMCI_CLASS(SVGFilterElement) DOMCI_CLASS(SVGImageElement) DOMCI_CLASS(SVGMarkerElement) DOMCI_CLASS(SVGMaskElement) -DOMCI_CLASS(SVGScriptElement) DOMCI_CLASS(SVGStopElement) DOMCI_CLASS(SVGStyleElement) DOMCI_CLASS(SVGSVGElement) diff --git a/dom/interfaces/svg/Makefile.in b/dom/interfaces/svg/Makefile.in index 142731609f80..1e95fcdb4fed 100644 --- a/dom/interfaces/svg/Makefile.in +++ b/dom/interfaces/svg/Makefile.in @@ -36,7 +36,6 @@ XPIDLSRCS = \ nsIDOMSVGMaskElement.idl \ nsIDOMSVGNumber.idl \ nsIDOMSVGRect.idl \ - nsIDOMSVGScriptElement.idl \ nsIDOMSVGSVGElement.idl \ nsIDOMSVGStopElement.idl \ nsIDOMSVGStringList.idl \ diff --git a/dom/interfaces/svg/nsIDOMSVGScriptElement.idl b/dom/interfaces/svg/nsIDOMSVGScriptElement.idl deleted file mode 100644 index 8bd08ecea771..000000000000 --- a/dom/interfaces/svg/nsIDOMSVGScriptElement.idl +++ /dev/null @@ -1,26 +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(B3314A7D-9909-4367-BBDB-9FAFB069CDFD)] -interface nsIDOMSVGScriptElement - : 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, - nsIDOMSVGExternalResourcesRequired -*/ -{ - attribute DOMString type; - // raises DOMException on setting - attribute DOMString crossOrigin; -}; diff --git a/dom/webidl/SVGScriptElement.webidl b/dom/webidl/SVGScriptElement.webidl index 36be40fa19cf..5bd2273d183b 100644 --- a/dom/webidl/SVGScriptElement.webidl +++ b/dom/webidl/SVGScriptElement.webidl @@ -11,9 +11,11 @@ */ interface SVGScriptElement : SVGElement { + [SetterThrows] attribute DOMString type; // CORS attribute + [SetterThrows] attribute DOMString crossOrigin; };