mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-04 11:26:09 +00:00
Backed out changeset 477309013214
This commit is contained in:
parent
69130aa897
commit
5c1de36d38
@ -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,
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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<nsINodeInfo> nodeInfo(aNodeInfo);
|
||||
if (!nodeInfo) {
|
||||
nsCOMPtr<nsIDocument> 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);
|
||||
}
|
||||
|
@ -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)
|
||||
|
Binary file not shown.
@ -1,28 +0,0 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Media test: Audio Constructor Test 1</title>
|
||||
<script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
||||
</head>
|
||||
<body>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
var timeout = setTimeout(function () {
|
||||
ok(false, "Test timed out");
|
||||
SimpleTest.finish();
|
||||
}, 30000);
|
||||
var a1 = new Audio();
|
||||
a1.onload = function() {
|
||||
ok(a1.networkState == a1.LOADED, "Audio onload");
|
||||
clearTimeout(timeout);
|
||||
SimpleTest.finish();
|
||||
}
|
||||
a1.src = 'sound.ogg';
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
@ -1,27 +0,0 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Media test: Audio Constructor Test 2</title>
|
||||
<script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
||||
</head>
|
||||
<body>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
var timeout = setTimeout(function () {
|
||||
ok(false, "Test timed out");
|
||||
SimpleTest.finish();
|
||||
}, 30000);
|
||||
var a1 = new Audio('sound.ogg');
|
||||
a1.onload = function() {
|
||||
ok(a1.networkState == a1.LOADED, "Audio onload");
|
||||
clearTimeout(timeout);
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
@ -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__ */
|
||||
|
@ -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<nsIContent> 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<nsICategoryManager> 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,
|
||||
|
Loading…
Reference in New Issue
Block a user