mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backed out changeset 389eee1cce65 (bug 677122) due to bustage.
This commit is contained in:
commit
15a66966a1
@ -363,25 +363,6 @@ MediaDocument::LinkStylesheet(const nsAString& aStylesheet)
|
||||
return head->AppendChildTo(link, false);
|
||||
}
|
||||
|
||||
void
|
||||
MediaDocument::InsertMediaFragmentScript()
|
||||
{
|
||||
nsCOMPtr<nsINodeInfo> nodeInfo;
|
||||
nodeInfo = mNodeInfoManager->GetNodeInfo(nsGkAtoms::script, nsnull,
|
||||
kNameSpaceID_XHTML,
|
||||
nsIDOMNode::ELEMENT_NODE);
|
||||
if (!nodeInfo)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
nsRefPtr<nsGenericHTMLElement> script = NS_NewHTMLScriptElement(nodeInfo.forget());
|
||||
script->SetTextContent(NS_LITERAL_STRING("window.addEventListener('hashchange',function(e){document.querySelector('audio,video').src=e.newURL;},false);"));
|
||||
|
||||
Element* head = GetHeadElement();
|
||||
head->AppendChildTo(script, false);
|
||||
}
|
||||
|
||||
void
|
||||
MediaDocument::UpdateTitleAndCharset(const nsACString& aTypeStr,
|
||||
const char* const* aFormatNames,
|
||||
@ -458,10 +439,6 @@ MediaDocument::SetScriptGlobalObject(nsIScriptGlobalObject* aGlobalObject)
|
||||
nsContentUtils::AddScriptRunner(
|
||||
new nsDocElementCreatedNotificationRunner(this));
|
||||
}
|
||||
|
||||
if (aGlobalObject) {
|
||||
InsertMediaFragmentScript();
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace dom
|
||||
|
@ -75,7 +75,6 @@ protected:
|
||||
void GetFileName(nsAString& aResult);
|
||||
|
||||
nsresult LinkStylesheet(const nsAString& aStylesheet);
|
||||
void InsertMediaFragmentScript();
|
||||
|
||||
// |aFormatNames[]| needs to have four elements in the following order:
|
||||
// a format name with neither dimension nor file, a format name with
|
||||
|
@ -106,7 +106,6 @@ _TEST_FILES = test_bug1682.html \
|
||||
test_bug571981.html \
|
||||
test_bug677495.html \
|
||||
test_bug677495-1.html \
|
||||
test_bug677122.html \
|
||||
$(NULL)
|
||||
|
||||
ifneq (mobile,$(MOZ_BUILD_APP))
|
||||
|
@ -1,85 +0,0 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Media test: MediaDocument hashchange mediafragment.</title>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
||||
</head>
|
||||
<body>
|
||||
<iframe id = "iframe">
|
||||
</iframe>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
var url = "../../../media/test/seek.ogv";
|
||||
var iframe = document.getElementById("iframe");
|
||||
var expects = 5;
|
||||
var count = 0;
|
||||
var test;
|
||||
var tests = [
|
||||
{ start: 1, end: 2 },
|
||||
{ start: 3, end: 4 }
|
||||
];
|
||||
|
||||
var next = function () {
|
||||
|
||||
test = tests.shift();
|
||||
if (test) {
|
||||
|
||||
iframe.src = url + "#t=" + test.start + "," + test.end;
|
||||
} else {
|
||||
|
||||
ok(expects === ++count, "Expected number of tests run. Expected: " + expects + " Actual: " + count );
|
||||
SimpleTest.finish();
|
||||
}
|
||||
};
|
||||
|
||||
iframe.addEventListener("load", function (e) {
|
||||
|
||||
var media = iframe.contentWindow.document.querySelector("audio,video");
|
||||
|
||||
media.addEventListener("seeked", function () {
|
||||
|
||||
var currentTime = Math.round(media.currentTime);
|
||||
|
||||
count++;
|
||||
ok(currentTime === test.start, "Hashchange mediafragment start. Expected: " + test.start + " Actual: " + currentTime);
|
||||
}, false);
|
||||
|
||||
media.addEventListener("pause", function () {
|
||||
|
||||
var currentTime = Math.round(media.currentTime);
|
||||
|
||||
if (count === 1) {
|
||||
|
||||
count++;
|
||||
ok(currentTime === test.end, "Hashchange mediafragment end. Expected: " + test.end + " Actual: " + currentTime);
|
||||
}
|
||||
|
||||
next();
|
||||
}, false);
|
||||
|
||||
// having an ended event ensures we're more likely to fail, instead of timing out.
|
||||
media.addEventListener("ended", function () {
|
||||
|
||||
var currentTime = Math.round(media.currentTime);
|
||||
|
||||
if (count === 3) {
|
||||
|
||||
count++;
|
||||
ok(currentTime === test.end, "Hashchange mediafragment end. Expected: " + test.end + " Actual: " + currentTime);
|
||||
}
|
||||
|
||||
next();
|
||||
}, false);
|
||||
|
||||
next();
|
||||
}, false);
|
||||
|
||||
iframe.src = url;
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user