зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset b873bd70913f
--HG-- extra : rebase_source : 5edfb17304688d81579eca39df35f1a71f622f62
This commit is contained in:
Родитель
8e20bd218f
Коммит
f4bcf684b5
|
@ -71,7 +71,6 @@ REQUIRES = xpcom \
|
|||
xpconnect \
|
||||
unicharutil \
|
||||
commandhandler \
|
||||
mimetype \
|
||||
composer \
|
||||
editor \
|
||||
plugin \
|
||||
|
|
|
@ -40,8 +40,6 @@
|
|||
#include "nsNodeInfoManager.h"
|
||||
#include "nsContentCreatorFunctions.h"
|
||||
#include "nsHTMLMediaElement.h"
|
||||
#include "nsIMIMEService.h"
|
||||
#include "nsIMIMEInfo.h"
|
||||
|
||||
class nsVideoDocument : public nsMediaDocument
|
||||
{
|
||||
|
@ -55,10 +53,6 @@ public:
|
|||
nsIContentSink* aSink = nsnull);
|
||||
|
||||
protected:
|
||||
|
||||
// Sets document <title> to reflect the file name and description.
|
||||
void UpdateTitle(nsIChannel* aChannel);
|
||||
|
||||
nsresult CreateSyntheticVideoDocument(nsIChannel* aChannel,
|
||||
nsIStreamListener** aListener);
|
||||
|
||||
|
@ -117,48 +111,14 @@ nsVideoDocument::CreateSyntheticVideoDocument(nsIChannel* aChannel,
|
|||
static_cast<nsHTMLMediaElement*>(NS_NewHTMLVideoElement(nodeInfo, PR_FALSE));
|
||||
if (!element)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
element->SetAutoplay(PR_TRUE);
|
||||
element->SetControls(PR_TRUE);
|
||||
element->LoadWithChannel(aChannel, aListener);
|
||||
UpdateTitle(aChannel);
|
||||
|
||||
return body->AppendChildTo(element, PR_FALSE);
|
||||
}
|
||||
|
||||
void
|
||||
nsVideoDocument::UpdateTitle(nsIChannel* aChannel)
|
||||
{
|
||||
if (!aChannel)
|
||||
return;
|
||||
|
||||
nsCOMPtr<nsIMIMEService> mimeService(do_GetService("@mozilla.org/mime;1"));
|
||||
if (!mimeService)
|
||||
return;
|
||||
|
||||
nsCAutoString contentType;
|
||||
if (NS_FAILED(aChannel->GetContentType(contentType)))
|
||||
return;
|
||||
|
||||
nsCOMPtr<nsIMIMEInfo> mimeInfo;
|
||||
mimeService->GetFromTypeAndExtension(contentType,
|
||||
EmptyCString(),
|
||||
getter_AddRefs(mimeInfo));
|
||||
nsAutoString description;
|
||||
mimeInfo->GetDescription(description);
|
||||
|
||||
static const char* const formatNames[4] = {
|
||||
"VideoFileNameWithTypeAndDimensions",
|
||||
"VideoFileNameWithType",
|
||||
"VideoFileNameWithDimensions",
|
||||
"VideoFileNameWithNeitherDimensionsNorFile",
|
||||
};
|
||||
nsXPIDLString status;
|
||||
nsMediaDocument::UpdateTitleAndCharset(NS_ConvertUTF16toUTF8(description),
|
||||
formatNames,
|
||||
0,
|
||||
0,
|
||||
status);
|
||||
}
|
||||
|
||||
nsresult
|
||||
NS_NewVideoDocument(nsIDocument** aResult)
|
||||
{
|
||||
|
|
|
@ -79,10 +79,9 @@ _TEST_FILES += \
|
|||
test_timeupdate1.html \
|
||||
test_timeupdate2.html \
|
||||
test_timeupdate3.html \
|
||||
test_videoDocumentTitle.html \
|
||||
320x240.ogv \
|
||||
320x240.ogg \
|
||||
bug461281.ogg \
|
||||
seek.ogv \
|
||||
seek.ogg \
|
||||
$(NULL)
|
||||
else
|
||||
_TEST_FILES += \
|
||||
|
@ -92,7 +91,6 @@ endif
|
|||
|
||||
ifdef MOZ_WAVE
|
||||
_TEST_FILES += \
|
||||
test_audioDocumentTitle.html \
|
||||
big.wav \
|
||||
test_bug463162.xhtml \
|
||||
test_can_play_type_wave.html \
|
||||
|
|
|
@ -1,53 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=463830
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 463830</title>
|
||||
<script type="application/javascript" src="/MochiKit/MochiKit.js"></script>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=463830">Mozilla Bug 463830</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script type="application/javascript">
|
||||
|
||||
/** Test for Bug 463830 **/
|
||||
|
||||
var gTests = [
|
||||
{ file: "r11025_s16_c1.wav", title: "r11025_s16_c1.wav (Wave Sound)" }
|
||||
];
|
||||
|
||||
var gTestNum = 0;
|
||||
|
||||
addLoadEvent(runTest);
|
||||
|
||||
function runTest() {
|
||||
if (gTestNum == gTests.length) {
|
||||
SimpleTest.finish();
|
||||
return;
|
||||
}
|
||||
var file = gTests[gTestNum].file;
|
||||
var title = gTests[gTestNum].title;
|
||||
var w = window.open(file, "", "width=500,height=300");
|
||||
w.onload =
|
||||
function() {
|
||||
is(w.document.title, title, "Audio doc title incorrect");
|
||||
w.close();
|
||||
setTimeout(runTest, 0);
|
||||
};
|
||||
gTestNum++;
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
|
@ -14,7 +14,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=448534
|
|||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=448535">Mozilla Bug 448534</a>
|
||||
<!-- Ogg video obtained from Theora test suite: http://v2v.cc/~j/theora_testsuite/ -->
|
||||
<video id='v'
|
||||
src='320x240.ogv'
|
||||
src='320x240.ogg'
|
||||
onloadedmetadata='return loaded();'
|
||||
onplay='return started();'
|
||||
onpause='return stopped();'></video>
|
||||
|
|
|
@ -31,11 +31,11 @@ branch.setBoolPref("wave.enabled", false);
|
|||
</script>
|
||||
|
||||
<video id="video1">
|
||||
<source type="video/ogg" src="320x240.ogv"/>
|
||||
<source type="video/ogg" src="320x240.ogg"/>
|
||||
<source type="audio/wave" src="r11025_u8_c1.wav"/>
|
||||
</video>
|
||||
|
||||
<video id="video2" src="320x240.ogv"></video>
|
||||
<video id="video2" src="320x240.ogg"></video>
|
||||
<video id="video3" src="r11025_u8_c1.wav"></video>
|
||||
|
||||
<script>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
</head>
|
||||
<body>
|
||||
<video id='v'
|
||||
src='seek.ogv'
|
||||
src='seek.ogg'
|
||||
onloadedmetadata='return startTest();'></video>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
</head>
|
||||
<body>
|
||||
<video id='v'
|
||||
src='seek.ogv'
|
||||
src='seek.ogg'
|
||||
onloadedmetadata='return startTest();'
|
||||
onended='return playbackEnded();'></video>
|
||||
<pre id="test">
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
</head>
|
||||
<body>
|
||||
<video id='v'
|
||||
src='seek.ogv'
|
||||
src='seek.ogg'
|
||||
onloadedmetadata='return startTest();'
|
||||
onplay='return playbackStarted();'
|
||||
onended='return playbackEnded();'></video>
|
||||
|
|
|
@ -95,11 +95,11 @@ function check_wav(e) {
|
|||
|
||||
var nextTest = 0;
|
||||
var subTests = [
|
||||
maketest(true, set_src, '320x240.ogv', null, check_ogg),
|
||||
maketest(true, add_source, '320x240.ogv', null, check_ogg),
|
||||
maketest(true, add_source, '320x240.ogv', 'application/ogg', check_ogg),
|
||||
maketest(true, add_sources_last, '320x240.ogv', null, check_ogg),
|
||||
maketest(true, add_sources_first, '320x240.ogv', 'application/ogg', check_ogg),
|
||||
maketest(true, set_src, '320x240.ogg', null, check_ogg),
|
||||
maketest(true, add_source, '320x240.ogg', null, check_ogg),
|
||||
maketest(true, add_source, '320x240.ogg', 'application/ogg', check_ogg),
|
||||
maketest(true, add_sources_last, '320x240.ogg', null, check_ogg),
|
||||
maketest(true, add_sources_first, '320x240.ogg', 'application/ogg', check_ogg),
|
||||
maketest(true, set_src, 'r11025_u8_c1.wav', null, check_wav),
|
||||
maketest(true, add_source, 'r11025_u8_c1.wav', null, check_wav),
|
||||
maketest(true, add_source, 'r11025_u8_c1.wav', 'audio/x-wav', check_wav),
|
||||
|
@ -107,11 +107,11 @@ var subTests = [
|
|||
maketest(true, add_sources_first, 'r11025_u8_c1.wav', 'audio/x-wav', check_wav),
|
||||
|
||||
// type hint matches a decoder, actual type matches different decoder
|
||||
maketest(true, add_source, '320x240.ogv', 'audio/x-wav', check_ogg),
|
||||
maketest(true, add_source, '320x240.ogg', 'audio/x-wav', check_ogg),
|
||||
maketest(true, add_source, 'r11025_u8_c1.wav', 'application/ogg', check_wav),
|
||||
|
||||
// should not start loading, type excludes it from media candiate list
|
||||
maketest(false, add_source, '320x240.ogv', 'bogus/type', null),
|
||||
maketest(false, add_source, '320x240.ogg', 'bogus/type', null),
|
||||
maketest(false, add_source, 'r11025_u8_c1.wav', 'bogus/type', null),
|
||||
maketest(false, add_source, 'unknown.raw', 'bogus/type', null),
|
||||
|
||||
|
@ -120,8 +120,8 @@ var subTests = [
|
|||
// maketest(true, add_source, 'unknown.raw', 'audio/x-wav', null),
|
||||
|
||||
// element doesn't notice source children attached later, needs bug 462455 fixed
|
||||
// maketest(true, late_add_sources_last, '320x240.ogv', null, 0.2, 0.4),
|
||||
// maketest(true, late_add_sources_first, '320x240.ogv', 'application/ogg', 0.2, 0.4),
|
||||
// maketest(true, late_add_sources_last, '320x240.ogg', null, 0.2, 0.4),
|
||||
// maketest(true, late_add_sources_first, '320x240.ogg', 'application/ogg', 0.2, 0.4),
|
||||
// maketest(true, late_add_sources_last, 'r11025_u8_c1.wav', null, 0.2, 0.4),
|
||||
// maketest(true, late_add_sources_first, 'r11025_u8_c1.wav', 'audio/x-wav', 0.2, 0.4),
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=467972
|
|||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=467972">Mozilla Bug 467972</a>
|
||||
|
||||
<video id="v"
|
||||
src="320x240.ogv"
|
||||
src="320x240.ogg"
|
||||
onloadedmetadata="return loadedMetaData();"
|
||||
onended="playbackEnded();"
|
||||
onloadeddata="return loadedData();"
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
</head>
|
||||
<body>
|
||||
<video id='v'
|
||||
src='seek.ogv'
|
||||
src='seek.ogg'
|
||||
onended='return playbackEnded();'
|
||||
onloadedmetadata='return startTest();'
|
||||
onseeking='return seekStarted();'
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
</head>
|
||||
<body>
|
||||
<video id='v'
|
||||
src='seek.ogv'
|
||||
src='seek.ogg'
|
||||
onloadedmetadata='return startTest();'
|
||||
onended='return playbackEnded();'
|
||||
onseeking='return seekStarted();'
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
</head>
|
||||
<body>
|
||||
<video id='v'
|
||||
src='seek.ogv'
|
||||
src='seek.ogg'
|
||||
onloadedmetadata='return startTest();'
|
||||
onseeking='return seekStarted();'
|
||||
onseeked='return seekEnded();'></video>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
</head>
|
||||
<body>
|
||||
<video id='v'
|
||||
src='seek.ogv'
|
||||
src='seek.ogg'
|
||||
onloadedmetadata='return startTest();'
|
||||
onseeking='return seekStarted();'
|
||||
onseeked='return seekEnded();'></video>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
</head>
|
||||
<body>
|
||||
<video id='v'
|
||||
src='seek.ogv'
|
||||
src='seek.ogg'
|
||||
onloadedmetadata='return startTest();'
|
||||
onended='return playbackEnded();'
|
||||
onseeking='return seekStarted();'
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
</head>
|
||||
<body>
|
||||
<video id='v'
|
||||
src='seek.ogv'
|
||||
src='seek.ogg'
|
||||
onloadedmetadata='return startTest();'
|
||||
onseeked='return seekEnded();'></video>
|
||||
<pre id="test">
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
</head>
|
||||
<body>
|
||||
<video id='v'
|
||||
src='seek.ogv'
|
||||
src='seek.ogg'
|
||||
onloadedmetadata='return startTest();'></video>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
</head>
|
||||
<body onload="doTest()">
|
||||
|
||||
<iframe id="i" src="320x240.ogv"></iframe>
|
||||
<iframe id="i" src="320x240.ogg"></iframe>
|
||||
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
@ -18,7 +18,7 @@ function doTest()
|
|||
{
|
||||
var elem = document.getElementById("i").contentDocument.body.firstChild;
|
||||
is(elem.tagName.toLowerCase(), "video", "Is video element");
|
||||
is(elem.currentSrc.substring(elem.currentSrc.length - 11), "320x240.ogv", "currentSrc");
|
||||
is(elem.currentSrc.substring(elem.currentSrc.length - 11), "320x240.ogg", "currentSrc");
|
||||
is(elem.controls, true, "Controls set");
|
||||
is(elem.autoplay, true, "Autoplay set");
|
||||
SimpleTest.finish();
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
</head>
|
||||
<body>
|
||||
<video id='v'
|
||||
src='seek.ogv'
|
||||
src='seek.ogg'
|
||||
onloadedmetadata='return startTest();'
|
||||
onended='return playbackEnded();'
|
||||
ontimeupdate='return timeUpdated();'></video>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
</head>
|
||||
<body>
|
||||
<video id='v'
|
||||
src='seek.ogv'
|
||||
src='seek.ogg'
|
||||
onloadedmetadata='return startTest();'
|
||||
ontimeupdate='return timeUpdated();'></video>
|
||||
<pre id="test">
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
</head>
|
||||
<body>
|
||||
<video id='v'
|
||||
src='seek.ogv'
|
||||
src='seek.ogg'
|
||||
onloadedmetadata='return startTest();'
|
||||
onseeking='return startSeek();'
|
||||
ontimeupdate='return timeUpdated();'></video>
|
||||
|
|
|
@ -1,54 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=463830
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 463830</title>
|
||||
<script type="application/javascript" src="/MochiKit/MochiKit.js"></script>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=463830">Mozilla Bug 463830</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script type="application/javascript">
|
||||
|
||||
/** Test for Bug 463830 **/
|
||||
|
||||
var gTests = [
|
||||
{ file: "320x240.ogv", title: "320x240.ogv (Ogg Video)" },
|
||||
{ file: "bug461281.ogg", title: "bug461281.ogg (Ogg Video)" },
|
||||
];
|
||||
|
||||
var gTestNum = 0;
|
||||
|
||||
addLoadEvent(runTest);
|
||||
|
||||
function runTest() {
|
||||
if (gTestNum == gTests.length) {
|
||||
SimpleTest.finish();
|
||||
return;
|
||||
}
|
||||
var file = gTests[gTestNum].file;
|
||||
var title = gTests[gTestNum].title;
|
||||
var w = window.open(file, "", "width=500,height=300");
|
||||
w.onload =
|
||||
function() {
|
||||
is(w.document.title, title, "Video doc title incorrect");
|
||||
w.close();
|
||||
setTimeout(runTest, 0);
|
||||
};
|
||||
gTestNum++;
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
|
@ -41,23 +41,12 @@
|
|||
#LOCALIZATION NOTE (ImageTitleWithoutDimensions): first %S is filename, second %S is type
|
||||
#LOCALIZATION NOTE (ImageTitleWithDimensions): first %S is type, second %S is width and third %S is height
|
||||
#LOCALIZATION NOTE (ImageTitleWithNeitherDimensionsNorFile): first %S is type
|
||||
#LOCALIZATION NOTE (VideoFileNameWithTypeAndDimensions): first %S is filename, seond %S is type, third %S is width, fourth %S is height.
|
||||
#LOCALIZATION NOTE (VideoFileNameWithType): first %S is filename, second %S is type
|
||||
#LOCALIZATION NOTE (VideoFileNameWithDimensions): first %S is filename, seond $S is width, third %S is height
|
||||
#LOCALIZATION NOTE (VideoFileNameWithNeitherDimensionsNorFile): first %S is filename.
|
||||
#LOCALIZATION NOTE (MediaTitleWithFile): first %S is filename, second %S is type
|
||||
#LOCALIZATION NOTE (MediaTitleWithNoInfo): first %S is type
|
||||
|
||||
ImageTitleWithDimensionsAndFile=%S (%S Image, %Sx%S pixels)
|
||||
ImageTitleWithoutDimensions=%S (%S Image)
|
||||
ImageTitleWithDimensions=(%S Image, %Sx%S pixels)
|
||||
ImageTitleWithNeitherDimensionsNorFile=(%S Image)
|
||||
|
||||
VideoFileNameWithTypeAndDimensions=%S (%S, %Sx%S pixels)
|
||||
VideoFileNameWithType=%S (%S)
|
||||
VideoFileNameWithDimensions=%S (%Sx%S pixels)
|
||||
VideoFileNameWithNeitherDimensionsNorFile=%S
|
||||
|
||||
MediaTitleWithFile=%S (%S Object)
|
||||
MediaTitleWithNoInfo=(%S Object)
|
||||
|
||||
|
|
|
@ -96,8 +96,6 @@
|
|||
#define APPLICATION_XPINSTALL "application/x-xpinstall"
|
||||
|
||||
#define AUDIO_BASIC "audio/basic"
|
||||
#define AUDIO_OGG "audio/ogg"
|
||||
#define AUDIO_WAV "audio/x-wav"
|
||||
|
||||
#define IMAGE_GIF "image/gif"
|
||||
#define IMAGE_JPG "image/jpeg"
|
||||
|
@ -145,7 +143,6 @@
|
|||
#define TEXT_XUL "application/vnd.mozilla.xul+xml"
|
||||
|
||||
#define VIDEO_MPEG "video/mpeg"
|
||||
#define VIDEO_OGG "video/ogg"
|
||||
|
||||
/* x-uuencode-apple-single. QuickMail made me do this. */
|
||||
#define UUENCODE_APPLE_SINGLE "x-uuencode-apple-single"
|
||||
|
|
|
@ -538,10 +538,10 @@ static nsExtraMimeTypeEntry extraMimeEntries [] =
|
|||
{ TEXT_XUL, "xul", "XML-Based User Interface Language", MAC_TYPE('TEXT'), MAC_TYPE('ttxt') },
|
||||
{ TEXT_XML, "xml,xsl,xbl", "Extensible Markup Language", MAC_TYPE('TEXT'), MAC_TYPE('ttxt') },
|
||||
{ TEXT_CSS, "css", "Style Sheet", MAC_TYPE('TEXT'), MAC_TYPE('ttxt') },
|
||||
{ AUDIO_OGG, "oga", "Ogg Audio", 0, 0 },
|
||||
{ VIDEO_OGG, "ogv", "Ogg Video", 0, 0 },
|
||||
{ VIDEO_OGG, "ogg", "Ogg Video", 0, 0 },
|
||||
{ AUDIO_WAV, "wav", "Waveform Audio", 0, 0 }
|
||||
{ "audio/ogg", "oga", "Ogg Audio", 0, 0 },
|
||||
{ "video/ogg", "ogv", "Ogg Video", 0, 0 },
|
||||
{ "audio/ogg", "ogg", "Ogg Audio", 0, 0 },
|
||||
{ "audio/x-wav", "wav", "Waveform Audio", 0, 0 }
|
||||
};
|
||||
|
||||
#undef MAC_TYPE
|
||||
|
|
Загрузка…
Ссылка в новой задаче