From d3a4cc2185d789431db89583faa1a8d936b0042f Mon Sep 17 00:00:00 2001 From: Matthew Gregan Date: Tue, 14 Aug 2012 15:26:43 +1200 Subject: [PATCH] Bug 770945 - Simple media events shouldn't be cancelable. r=roc --- content/events/src/nsDOMNotifyAudioAvailableEvent.cpp | 4 +--- content/html/content/src/nsHTMLMediaElement.cpp | 6 +++--- content/media/test/test_error_on_404.html | 1 - dom/interfaces/events/nsIDOMNotifyAudioAvailableEvent.idl | 4 +--- 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/content/events/src/nsDOMNotifyAudioAvailableEvent.cpp b/content/events/src/nsDOMNotifyAudioAvailableEvent.cpp index f7c1b9656ec..13290e9e942 100644 --- a/content/events/src/nsDOMNotifyAudioAvailableEvent.cpp +++ b/content/events/src/nsDOMNotifyAudioAvailableEvent.cpp @@ -101,8 +101,6 @@ nsDOMNotifyAudioAvailableEvent::GetTime(float *aRetVal) NS_IMETHODIMP nsDOMNotifyAudioAvailableEvent::InitAudioAvailableEvent(const nsAString& aType, - bool aCanBubble, - bool aCancelable, float* aFrameBuffer, PRUint32 aFrameBufferLength, float aTime, @@ -112,7 +110,7 @@ nsDOMNotifyAudioAvailableEvent::InitAudioAvailableEvent(const nsAString& aType, // that if we exit due to some error, the memory will be freed. Otherwise, // the framebuffer's memory will be freed when this event is destroyed. nsAutoArrayPtr frameBuffer(aFrameBuffer); - nsresult rv = nsDOMEvent::InitEvent(aType, aCanBubble, aCancelable); + nsresult rv = nsDOMEvent::InitEvent(aType, false, false); NS_ENSURE_SUCCESS(rv, rv); mFrameBuffer = frameBuffer.forget(); diff --git a/content/html/content/src/nsHTMLMediaElement.cpp b/content/html/content/src/nsHTMLMediaElement.cpp index 361b9706e05..b6bad9a5c76 100644 --- a/content/html/content/src/nsHTMLMediaElement.cpp +++ b/content/html/content/src/nsHTMLMediaElement.cpp @@ -213,7 +213,7 @@ public: mSource, NS_LITERAL_STRING("error"), false, - true); + false); } }; @@ -3069,7 +3069,7 @@ nsresult nsHTMLMediaElement::DispatchAudioAvailableEvent(float* aFrameBuffer, NS_ENSURE_SUCCESS(rv, rv); rv = audioavailableEvent->InitAudioAvailableEvent(NS_LITERAL_STRING("MozAudioAvailable"), - true, true, frameBuffer.forget(), aFrameBufferLength, + frameBuffer.forget(), aFrameBufferLength, aTime, mAllowAudioData); NS_ENSURE_SUCCESS(rv, rv); @@ -3093,7 +3093,7 @@ nsresult nsHTMLMediaElement::DispatchEvent(const nsAString& aName) static_cast(this), aName, false, - true); + false); } nsresult nsHTMLMediaElement::DispatchAsyncEvent(const nsAString& aName) diff --git a/content/media/test/test_error_on_404.html b/content/media/test/test_error_on_404.html index a89ccc57516..b1d0ac729d9 100644 --- a/content/media/test/test_error_on_404.html +++ b/content/media/test/test_error_on_404.html @@ -42,7 +42,6 @@ function FinishedLoads() { } function loadError(evt) { - // Prevent mochitest's onerror handler catching the 'error' event on bubble. var v = evt.target; is(v._loadError, false, "Shouldn't receive multiple error events for " + v.src); v._loadError = true; diff --git a/dom/interfaces/events/nsIDOMNotifyAudioAvailableEvent.idl b/dom/interfaces/events/nsIDOMNotifyAudioAvailableEvent.idl index aa4c1ded848..a225ce8b8bc 100644 --- a/dom/interfaces/events/nsIDOMNotifyAudioAvailableEvent.idl +++ b/dom/interfaces/events/nsIDOMNotifyAudioAvailableEvent.idl @@ -7,7 +7,7 @@ #include "nsIDOMEvent.idl" #include "nsIVariant.idl" -[scriptable, builtinclass, uuid(34139b4f-ac78-4372-98d3-12d6dcf478ef)] +[scriptable, builtinclass, uuid(03957748-6878-4bb5-9c34-2c509a17ca5f)] interface nsIDOMNotifyAudioAvailableEvent : nsIDOMEvent { [implicit_jscontext] @@ -16,8 +16,6 @@ interface nsIDOMNotifyAudioAvailableEvent : nsIDOMEvent readonly attribute float time; void initAudioAvailableEvent(in DOMString typeArg, - in boolean canBubbleArg, - in boolean cancelableArg, [array, size_is(frameBufferLength)] in float frameBufferPtr, in unsigned long frameBufferLength, in float time,