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
This commit is contained in:
Robert O'Callahan 2013-06-04 15:28:23 +12:00
Родитель 532d5ad82a
Коммит aa60d410a4
9 изменённых файлов: 4 добавлений и 135 удалений

Просмотреть файл

@ -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;

Просмотреть файл

@ -502,8 +502,6 @@ public:
JSObject* MozGetMetadata(JSContext* aCx, ErrorResult& aRv);
void MozLoadFrom(HTMLMediaElement& aOther, ErrorResult& aRv);
double MozFragmentEnd();
// XPCOM GetMozAudioChannelType() is OK

Просмотреть файл

@ -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<nsIContent> content = do_QueryInterface(aOther);
HTMLMediaElement* other = static_cast<HTMLMediaElement*>(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)
{

Просмотреть файл

@ -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 \

Просмотреть файл

@ -1,65 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Test mozLoadFrom API</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
<script type="text/javascript" src="manifest.js"></script>
</head>
<body>
<pre id="test">
<script class="testbody" type="text/javascript">
var manager = new MediaTestManager;
function cloneLoaded(event) {
ok(true, "Clone loaded OK");
var e = event.target;
if (e._expectedDuration) {
ok(Math.abs(e.duration - e._expectedDuration) < 0.1,
"Clone " + e.currentSrc + " duration: " + e.duration + " expected: " + e._expectedDuration);
}
manager.finished(e.token);
}
function tryClone(event) {
var e = event.target;
var clone = e.cloneNode(false);
clone.token = e.token;
if (e._expectedDuration) {
ok(Math.abs(e.duration - e._expectedDuration) < 0.1,
e.currentSrc + " duration: " + e.duration + " expected: " + e._expectedDuration);
clone._expectedDuration = e._expectedDuration;
}
clone.mozLoadFrom(e);
is(clone.currentSrc, e.currentSrc, "Clone source OK");
clone.addEventListener("loadeddata", cloneLoaded, false);
}
function initTest(test, token) {
var elemType = /^audio/.test(test.type) ? "audio" : "video";
var e = document.createElement(elemType);
if (e.canPlayType(test.type)) {
e.src = test.name;
if (test.duration) {
e._expectedDuration = test.duration;
}
e.addEventListener("loadeddata", tryClone, false);
e.load();
e.token = token;
manager.started(token);
}
}
manager.runTests(gCloneTests, initTest);
</script>
</pre>
</body>
</html>

Просмотреть файл

@ -16,7 +16,7 @@
* @status UNDER_DEVELOPMENT
*/
[scriptable, uuid(2d6580a3-bb24-4f13-8c49-09e332a50049)]
[scriptable, uuid(fdfda110-e96b-4e98-8716-167a6555c80a)]
interface nsIDOMHTMLAudioElement : nsIDOMHTMLMediaElement
{
};

Просмотреть файл

@ -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.

Просмотреть файл

@ -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;

Просмотреть файл

@ -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.