diff --git a/content/html/content/public/nsHTMLAudioElement.h b/content/html/content/public/nsHTMLAudioElement.h index e039ab239d5..6920a37b466 100644 --- a/content/html/content/public/nsHTMLAudioElement.h +++ b/content/html/content/public/nsHTMLAudioElement.h @@ -36,7 +36,6 @@ * * ***** END LICENSE BLOCK ***** */ #include "nsIDOMHTMLAudioElement.h" -#include "nsIJSNativeInitializer.h" #include "nsHTMLMediaElement.h" #include "nsVideoDecoder.h" @@ -44,8 +43,7 @@ typedef PRUint16 nsMediaNetworkState; typedef PRUint16 nsMediaReadyState; class nsHTMLAudioElement : public nsHTMLMediaElement, - public nsIDOMHTMLAudioElement, - public nsIJSNativeInitializer + public nsIDOMHTMLAudioElement { public: nsHTMLAudioElement(nsINodeInfo *aNodeInfo, PRBool aFromParser = PR_FALSE); @@ -69,10 +67,6 @@ public: // nsIDOMHTMLAudioElement NS_DECL_NSIDOMHTMLAUDIOELEMENT - // nsIJSNativeInitializer - NS_IMETHOD Initialize(nsISupports* aOwner, JSContext* aContext, - JSObject* aObj, PRUint32 argc, jsval* argv); - virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const; virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent, nsIContent* aBindingParent, diff --git a/content/html/content/src/Makefile.in b/content/html/content/src/Makefile.in index 33d9cb3c13e..962a240e57f 100644 --- a/content/html/content/src/Makefile.in +++ b/content/html/content/src/Makefile.in @@ -155,7 +155,6 @@ INCLUDES += \ -I$(srcdir)/../../../xbl/src \ -I$(srcdir)/../../../../layout/style \ -I$(srcdir)/../../../../layout/tables \ - -I$(srcdir)/../../../../dom/src/base \ -I$(srcdir) \ $(NULL) diff --git a/content/html/content/src/nsHTMLAudioElement.cpp b/content/html/content/src/nsHTMLAudioElement.cpp index 6143b578502..8468548f500 100644 --- a/content/html/content/src/nsHTMLAudioElement.cpp +++ b/content/html/content/src/nsHTMLAudioElement.cpp @@ -55,7 +55,6 @@ #include "nsXPCOMStrings.h" #include "prlock.h" #include "nsThreadUtils.h" -#include "nsJSUtils.h" #include "nsIScriptSecurityManager.h" #include "nsIXPConnect.h" @@ -69,33 +68,13 @@ #include "nsIDOMProgressEvent.h" #include "nsHTMLMediaError.h" -nsGenericHTMLElement* -NS_NewHTMLAudioElement(nsINodeInfo *aNodeInfo, PRBool aFromParser) -{ - /* - * nsHTMLAudioElement's will be created without a nsINodeInfo passed in - * if someone says "var audio = new Audio();" in JavaScript, in a case like - * that we request the nsINodeInfo from the document's nodeinfo list. - */ - nsCOMPtr nodeInfo(aNodeInfo); - if (!nodeInfo) { - nsCOMPtr doc = - do_QueryInterface(nsContentUtils::GetDocumentFromCaller()); - NS_ENSURE_TRUE(doc, nsnull); - - nodeInfo = doc->NodeInfoManager()->GetNodeInfo(nsGkAtoms::audio, nsnull, - kNameSpaceID_None); - NS_ENSURE_TRUE(nodeInfo, nsnull); - } - - return new nsHTMLAudioElement(nodeInfo); -} +NS_IMPL_NS_NEW_HTML_ELEMENT_CHECK_PARSER(Audio) NS_IMPL_ADDREF_INHERITED(nsHTMLAudioElement, nsHTMLMediaElement) NS_IMPL_RELEASE_INHERITED(nsHTMLAudioElement, nsHTMLMediaElement) NS_HTML_CONTENT_INTERFACE_TABLE_HEAD(nsHTMLAudioElement, nsHTMLMediaElement) -NS_INTERFACE_TABLE_INHERITED2(nsHTMLAudioElement, nsIDOMHTMLAudioElement, nsIJSNativeInitializer) + NS_INTERFACE_TABLE_INHERITED1(nsHTMLAudioElement, nsIDOMHTMLAudioElement) NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLAudioElement) NS_IMPL_ELEMENT_CLONE(nsHTMLAudioElement) @@ -139,21 +118,3 @@ nsresult nsHTMLAudioElement::InitializeDecoder(nsAString& aChosenMediaResource) return nsHTMLMediaElement::InitializeDecoder(aChosenMediaResource); } - -NS_IMETHODIMP -nsHTMLAudioElement::Initialize(nsISupports* aOwner, JSContext* aContext, - JSObject *aObj, PRUint32 argc, jsval *argv) -{ - if (argc <= 0) { - // Nothing to do here if we don't get any arguments. - return NS_OK; - } - - // The only (optional) argument is the url of the audio - JSString* jsstr = JS_ValueToString(aContext, argv[0]); - if (!jsstr) - return NS_ERROR_FAILURE; - - nsDependentJSString str(jsstr); - return SetAttr(kNameSpaceID_None, nsGkAtoms::src, str, PR_TRUE); -} diff --git a/content/media/video/test/Makefile.in b/content/media/video/test/Makefile.in index 8952816fe8c..1de1a1581e2 100644 --- a/content/media/video/test/Makefile.in +++ b/content/media/video/test/Makefile.in @@ -43,9 +43,7 @@ relativesrcdir = content/media/video/test include $(DEPTH)/config/autoconf.mk include $(topsrcdir)/config/rules.mk -_TEST_FILES = test_audio1.html \ - test_audio2.html \ - test_autoplay.html \ +_TEST_FILES = test_autoplay.html \ test_constants.html \ test_controls.html \ test_currentTime.html \ @@ -55,7 +53,6 @@ _TEST_FILES = test_audio1.html \ test_playbackRate.html \ test_readyState.html \ test_start.html \ - sound.ogg \ # test_bug448534.html \ 320x240.ogg \ $(NULL) diff --git a/content/media/video/test/sound.ogg b/content/media/video/test/sound.ogg deleted file mode 100644 index edda4e91284..00000000000 Binary files a/content/media/video/test/sound.ogg and /dev/null differ diff --git a/content/media/video/test/test_audio1.html b/content/media/video/test/test_audio1.html deleted file mode 100644 index 37e9c3cf729..00000000000 --- a/content/media/video/test/test_audio1.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - Media test: Audio Constructor Test 1 - - - - - -
-
-
- - diff --git a/content/media/video/test/test_audio2.html b/content/media/video/test/test_audio2.html deleted file mode 100644 index 5a8029eacc2..00000000000 --- a/content/media/video/test/test_audio2.html +++ /dev/null @@ -1,27 +0,0 @@ - - - - Media test: Audio Constructor Test 2 - - - - - -
-
-
- - diff --git a/layout/build/nsLayoutCID.h b/layout/build/nsLayoutCID.h index 739f2af948b..c99b330077c 100644 --- a/layout/build/nsLayoutCID.h +++ b/layout/build/nsLayoutCID.h @@ -225,12 +225,4 @@ // {93ad72a6-02cd-4716-9626-d47d5ec275ec} #define NS_DOMJSON_CID \ { 0x93ad72a6, 0x02cd, 0x4716, { 0x96, 0x26, 0xd4, 0x7d, 0x5e, 0xc2, 0x75, 0xec } } - -#ifdef MOZ_MEDIA -#define NS_HTMLAUDIOELEMENT_CID \ -{ /* 1d40026b-4c44-4f6f-b158-26bb5e9c65e9 */ \ - 0x1d40026b, 0x4c44, 0x4f6f, \ - {0xb1, 0x58, 0x26, 0xbb, 0x5e, 0x9c, 0x65, 0xe9}} -#endif - #endif /* nsLayoutCID_h__ */ diff --git a/layout/build/nsLayoutModule.cpp b/layout/build/nsLayoutModule.cpp index c381954f0c5..fd064bf72a3 100644 --- a/layout/build/nsLayoutModule.cpp +++ b/layout/build/nsLayoutModule.cpp @@ -223,11 +223,6 @@ class nsIDocumentLoaderFactory; #define NS_HTMLOPTIONELEMENT_CONTRACTID \ "@mozilla.org/content/element/html;1?name=option" -#ifdef MOZ_MEDIA -#define NS_HTMLAUDIOELEMENT_CONTRACTID \ - "@mozilla.org/content/element/html;1?name=audio" -#endif - /* 0ddf4df8-4dbb-4133-8b79-9afb966514f5 */ #define NS_PLUGINDOCLOADERFACTORY_CID \ { 0x0ddf4df8, 0x4dbb, 0x4133, { 0x8b, 0x79, 0x9a, 0xfb, 0x96, 0x65, 0x14, 0xf5 } } @@ -497,7 +492,6 @@ MAKE_CTOR(CreatePreContentIterator, nsIContentIterator, NS_NewPre MAKE_CTOR(CreateSubtreeIterator, nsIContentIterator, NS_NewContentSubtreeIterator) // CreateHTMLImgElement, see below // CreateHTMLOptionElement, see below -// CreateHTMLAudioElement, see below MAKE_CTOR(CreateTextEncoder, nsIDocumentEncoder, NS_NewTextEncoder) MAKE_CTOR(CreateHTMLCopyTextEncoder, nsIDocumentEncoder, NS_NewHTMLCopyTextEncoder) MAKE_CTOR(CreateXMLContentSerializer, nsIContentSerializer, NS_NewXMLContentSerializer) @@ -674,53 +668,6 @@ UnregisterHTMLOptionElement(nsIComponentManager* aCompMgr, return NS_OK; } -#ifdef MOZ_MEDIA -static NS_IMETHODIMP -CreateHTMLAudioElement(nsISupports* aOuter, REFNSIID aIID, void** aResult) -{ - *aResult = nsnull; - if (aOuter) - return NS_ERROR_NO_AGGREGATION; - // Note! NS_NewHTMLAudioElement is special cased to handle a null nodeinfo - nsCOMPtr inst(NS_NewHTMLAudioElement(nsnull)); - return inst ? inst->QueryInterface(aIID, aResult) : NS_ERROR_OUT_OF_MEMORY; -} - -static NS_IMETHODIMP -RegisterHTMLAudioElement(nsIComponentManager *aCompMgr, - nsIFile* aPath, - const char* aRegistryLocation, - const char* aComponentType, - const nsModuleComponentInfo* aInfo) -{ - nsCOMPtr catman = - do_GetService(NS_CATEGORYMANAGER_CONTRACTID); - - if (!catman) - return NS_ERROR_FAILURE; - - nsXPIDLCString previous; - nsresult rv = catman->AddCategoryEntry(JAVASCRIPT_GLOBAL_CONSTRUCTOR_CATEGORY, - "Audio", NS_HTMLAUDIOELEMENT_CONTRACTID, - PR_TRUE, PR_TRUE, getter_Copies(previous)); - NS_ENSURE_SUCCESS(rv, rv); - - return catman->AddCategoryEntry(JAVASCRIPT_GLOBAL_CONSTRUCTOR_PROTO_ALIAS_CATEGORY, - "Audio", "HTMLAudioElement", - PR_TRUE, PR_TRUE, getter_Copies(previous)); -} - -static NS_IMETHODIMP -UnregisterHTMLAudioElement(nsIComponentManager* aCompMgr, - nsIFile* aPath, - const char* aRegistryLocation, - const nsModuleComponentInfo* aInfo) -{ - // XXX remove category entry - return NS_OK; -} -#endif - static NS_METHOD RegisterDataDocumentContentPolicy(nsIComponentManager *aCompMgr, nsIFile* aPath, @@ -1053,7 +1000,7 @@ static const nsModuleComponentInfo gComponents[] = { nsnull, nsInspectorCSSUtilsConstructor }, - // Needed to support "new Option;", "new Image;" and "new Audio;" in JavaScript + // Needed to support "new Option;" and "new Image;" in JavaScript { "HTML img element", NS_HTMLIMAGEELEMENT_CID, NS_HTMLIMGELEMENT_CONTRACTID, @@ -1068,15 +1015,6 @@ static const nsModuleComponentInfo gComponents[] = { RegisterHTMLOptionElement, UnregisterHTMLOptionElement }, -#ifdef MOZ_MEDIA - { "HTML audio element", - NS_HTMLAUDIOELEMENT_CID, - NS_HTMLAUDIOELEMENT_CONTRACTID, - CreateHTMLAudioElement, - RegisterHTMLAudioElement, - UnregisterHTMLAudioElement }, -#endif - #ifdef MOZ_ENABLE_CANVAS { "Canvas 2D Rendering Context", NS_CANVASRENDERINGCONTEXT2D_CID,