From aa60d410a457d533e2054382d7dcd1c7ffe907f8 Mon Sep 17 00:00:00 2001 From: Robert O'Callahan Date: Tue, 4 Jun 2013 15:28:23 +1200 Subject: [PATCH] Bug 877135. Remove HTMLMediaElement::mozLoadFrom since it's nonstandard and no longer needed (setting 'src' to another element's 'currentSrc' works just as well). r=doublec --HG-- extra : rebase_source : f1e04fe469a1757bfabfcf79bbf0fec29faee1c7 --- browser/base/content/pageinfo/pageInfo.js | 2 +- .../html/content/public/HTMLMediaElement.h | 2 - content/html/content/src/HTMLMediaElement.cpp | 46 ------------- content/media/test/Makefile.in | 1 - content/media/test/test_mozLoadFrom.html | 65 ------------------- .../html/nsIDOMHTMLAudioElement.idl | 2 +- .../html/nsIDOMHTMLMediaElement.idl | 10 +-- .../html/nsIDOMHTMLVideoElement.idl | 2 +- dom/webidl/HTMLMediaElement.webidl | 9 --- 9 files changed, 4 insertions(+), 135 deletions(-) delete mode 100644 content/media/test/test_mozLoadFrom.html diff --git a/browser/base/content/pageinfo/pageInfo.js b/browser/base/content/pageinfo/pageInfo.js index 32aca10987e1..7846bd36b5f6 100644 --- a/browser/base/content/pageinfo/pageInfo.js +++ b/browser/base/content/pageinfo/pageInfo.js @@ -1013,7 +1013,7 @@ function makePreview(row) else if (item instanceof HTMLVideoElement && isProtocolAllowed) { newImage = document.createElementNS("http://www.w3.org/1999/xhtml", "video"); newImage.id = "thepreviewimage"; - newImage.mozLoadFrom(item); + newImage.src = url; newImage.controls = true; width = physWidth = item.videoWidth; height = physHeight = item.videoHeight; diff --git a/content/html/content/public/HTMLMediaElement.h b/content/html/content/public/HTMLMediaElement.h index cd36eae8e752..d49fc61f0f68 100644 --- a/content/html/content/public/HTMLMediaElement.h +++ b/content/html/content/public/HTMLMediaElement.h @@ -502,8 +502,6 @@ public: JSObject* MozGetMetadata(JSContext* aCx, ErrorResult& aRv); - void MozLoadFrom(HTMLMediaElement& aOther, ErrorResult& aRv); - double MozFragmentEnd(); // XPCOM GetMozAudioChannelType() is OK diff --git a/content/html/content/src/HTMLMediaElement.cpp b/content/html/content/src/HTMLMediaElement.cpp index 0bf2913767d9..f34451719377 100644 --- a/content/html/content/src/HTMLMediaElement.cpp +++ b/content/html/content/src/HTMLMediaElement.cpp @@ -1210,52 +1210,6 @@ nsresult HTMLMediaElement::LoadWithChannel(nsIChannel* aChannel, return NS_OK; } -void -HTMLMediaElement::MozLoadFrom(HTMLMediaElement& aOther, ErrorResult& aRv) -{ - // Make sure we don't reenter during synchronous abort events. - if (mIsRunningLoadMethod) { - return; - } - - mIsRunningLoadMethod = true; - AbortExistingLoads(); - mIsRunningLoadMethod = false; - - if (!aOther.mDecoder) { - return; - } - - ChangeDelayLoadStatus(true); - - mLoadingSrc = aOther.mLoadingSrc; - aRv = InitializeDecoderAsClone(aOther.mDecoder); - if (aRv.Failed()) { - ChangeDelayLoadStatus(false); - return; - } - - SetPlaybackRate(mDefaultPlaybackRate); - DispatchAsyncEvent(NS_LITERAL_STRING("loadstart")); -} - -NS_IMETHODIMP HTMLMediaElement::MozLoadFrom(nsIDOMHTMLMediaElement* aOther) -{ - NS_ENSURE_ARG_POINTER(aOther); - - nsCOMPtr content = do_QueryInterface(aOther); - HTMLMediaElement* other = static_cast(content.get()); - - if (!other) { - return NS_ERROR_FAILURE; - } - - ErrorResult rv; - MozLoadFrom(*other, rv); - - return rv.ErrorCode(); -} - /* readonly attribute unsigned short readyState; */ NS_IMETHODIMP HTMLMediaElement::GetReadyState(uint16_t* aReadyState) { diff --git a/content/media/test/Makefile.in b/content/media/test/Makefile.in index b636649089d9..1439d9540c26 100644 --- a/content/media/test/Makefile.in +++ b/content/media/test/Makefile.in @@ -91,7 +91,6 @@ MOCHITEST_FILES = \ test_load_source.html \ test_loop.html \ test_metadata.html \ - test_mozLoadFrom.html \ test_no_load_event.html \ test_networkState.html \ test_new_audio.html \ diff --git a/content/media/test/test_mozLoadFrom.html b/content/media/test/test_mozLoadFrom.html deleted file mode 100644 index fa8af6f5bd08..000000000000 --- a/content/media/test/test_mozLoadFrom.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - Test mozLoadFrom API - - - - - - -
-
-
- - diff --git a/dom/interfaces/html/nsIDOMHTMLAudioElement.idl b/dom/interfaces/html/nsIDOMHTMLAudioElement.idl index 2dfc7d2b497c..98320c617fec 100644 --- a/dom/interfaces/html/nsIDOMHTMLAudioElement.idl +++ b/dom/interfaces/html/nsIDOMHTMLAudioElement.idl @@ -16,7 +16,7 @@ * @status UNDER_DEVELOPMENT */ -[scriptable, uuid(2d6580a3-bb24-4f13-8c49-09e332a50049)] +[scriptable, uuid(fdfda110-e96b-4e98-8716-167a6555c80a)] interface nsIDOMHTMLAudioElement : nsIDOMHTMLMediaElement { }; diff --git a/dom/interfaces/html/nsIDOMHTMLMediaElement.idl b/dom/interfaces/html/nsIDOMHTMLMediaElement.idl index 5cce6d422cb1..30d95c39078b 100644 --- a/dom/interfaces/html/nsIDOMHTMLMediaElement.idl +++ b/dom/interfaces/html/nsIDOMHTMLMediaElement.idl @@ -27,7 +27,7 @@ interface nsIDOMMediaStream; #endif %} -[scriptable, uuid(adbb2541-5ab6-41a3-9e16-fca46620b532)] +[scriptable, uuid(21354ac9-7166-46a0-a3f0-a3135c3cc804)] interface nsIDOMHTMLMediaElement : nsIDOMHTMLElement { // error state @@ -100,14 +100,6 @@ interface nsIDOMHTMLMediaElement : nsIDOMHTMLElement [implicit_jscontext] jsval mozGetMetadata(); - // Mozilla extension: load data from another media element. This is like - // load() but we don't run the resource selection algorithm; instead - // we just set our source to other's currentSrc. This is optimized - // so that this element will get access to all of other's cached/ - // buffered data. In fact any future data downloaded by this element or - // other will be sharable by both elements. - void mozLoadFrom(in nsIDOMHTMLMediaElement other); - // Mozilla extension: provides access to the fragment end time if // the media element has a fragment URI for the currentSrc, otherwise // it is equal to the media duration. diff --git a/dom/interfaces/html/nsIDOMHTMLVideoElement.idl b/dom/interfaces/html/nsIDOMHTMLVideoElement.idl index 1ecb1210add2..4d39eb799437 100644 --- a/dom/interfaces/html/nsIDOMHTMLVideoElement.idl +++ b/dom/interfaces/html/nsIDOMHTMLVideoElement.idl @@ -16,7 +16,7 @@ * @status UNDER_DEVELOPMENT */ -[scriptable, uuid(df152de2-9829-444a-b92b-83985b0978bd)] +[scriptable, uuid(b48ec2c0-7529-4212-9717-1ce95507e7e4)] interface nsIDOMHTMLVideoElement : nsIDOMHTMLMediaElement { attribute long width; diff --git a/dom/webidl/HTMLMediaElement.webidl b/dom/webidl/HTMLMediaElement.webidl index bc47a72bfacb..5704bf897e04 100644 --- a/dom/webidl/HTMLMediaElement.webidl +++ b/dom/webidl/HTMLMediaElement.webidl @@ -127,15 +127,6 @@ partial interface HTMLMediaElement { [Throws] object? mozGetMetadata(); - // Mozilla extension: load data from another media element. This is like - // load() but we don't run the resource selection algorithm; instead - // we just set our source to other's currentSrc. This is optimized - // so that this element will get access to all of other's cached/ - // buffered data. In fact any future data downloaded by this element or - // other will be sharable by both elements. - [Throws] - void mozLoadFrom(HTMLMediaElement other); - // Mozilla extension: provides access to the fragment end time if // the media element has a fragment URI for the currentSrc, otherwise // it is equal to the media duration.