зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1532692 - Clear poster attributes from videos that we're cloning to visually. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D22631 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
54ccd86c68
Коммит
6200b046ce
|
@ -461,6 +461,13 @@ void HTMLVideoElement::CloneElementVisually(HTMLVideoElement& aTargetVideo,
|
||||||
EndCloningVisually();
|
EndCloningVisually();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If there's a poster set on the target video, clear it, otherwise
|
||||||
|
// it'll display over top of the cloned frames.
|
||||||
|
aTargetVideo.UnsetHTMLAttr(nsGkAtoms::poster, rv);
|
||||||
|
if (rv.Failed()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!SetVisualCloneTarget(&aTargetVideo)) {
|
if (!SetVisualCloneTarget(&aTargetVideo)) {
|
||||||
rv.Throw(NS_ERROR_FAILURE);
|
rv.Throw(NS_ERROR_FAILURE);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -533,6 +533,7 @@ support-files =
|
||||||
parser.vtt
|
parser.vtt
|
||||||
pixel_aspect_ratio.mp4
|
pixel_aspect_ratio.mp4
|
||||||
play_promise.js
|
play_promise.js
|
||||||
|
poster-test.jpg
|
||||||
r11025_msadpcm_c1.wav
|
r11025_msadpcm_c1.wav
|
||||||
r11025_msadpcm_c1.wav^headers^
|
r11025_msadpcm_c1.wav^headers^
|
||||||
r11025_s16_c1.wav
|
r11025_s16_c1.wav
|
||||||
|
@ -1342,4 +1343,6 @@ tags = cloneelementvisually
|
||||||
[test_cloneElementVisually_no_suspend.html]
|
[test_cloneElementVisually_no_suspend.html]
|
||||||
skip-if = toolkit == 'android' # Visually cloning is only supported on Desktop for now.
|
skip-if = toolkit == 'android' # Visually cloning is only supported on Desktop for now.
|
||||||
tags = cloneelementvisually
|
tags = cloneelementvisually
|
||||||
|
[test_cloneElementVisually_poster.html]
|
||||||
|
skip-if = toolkit == 'android' # Visually cloning is only supported on Desktop for now.
|
||||||
|
tags = cloneelementvisually
|
||||||
|
|
Двоичный файл не отображается.
После Ширина: | Высота: | Размер: 57 KiB |
|
@ -0,0 +1,51 @@
|
||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Test cloneElementVisually</title>
|
||||||
|
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||||
|
<script type="application/javascript" src="https://example.com:443/tests/dom/media/test/cloneElementVisually_helpers.js"></script>
|
||||||
|
<script src="/tests/SimpleTest/AddTask.js"></script>
|
||||||
|
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="content">
|
||||||
|
<h1>Original</h1>
|
||||||
|
<video id="original"></video>
|
||||||
|
<h1>Clone</h1>
|
||||||
|
</div>
|
||||||
|
<div id="results">
|
||||||
|
<h1>Results</h1>
|
||||||
|
<canvas id="left"></canvas>
|
||||||
|
<canvas id="right"></canvas>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="application/javascript">
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test that when we start cloning a paused video, the clone displays
|
||||||
|
* the first paused frame.
|
||||||
|
*/
|
||||||
|
add_task(async () => {
|
||||||
|
await setup();
|
||||||
|
|
||||||
|
let originalVideo = document.getElementById("original");
|
||||||
|
const POSTER_URL = "https://example.com:443/tests/dom/media/test/poster-test.jpg";
|
||||||
|
originalVideo.setAttribute("poster", POSTER_URL);
|
||||||
|
|
||||||
|
await withNewClone(originalVideo, async clone => {
|
||||||
|
SpecialPowers.wrap(originalVideo).cloneElementVisually(clone);
|
||||||
|
await originalVideo.play();
|
||||||
|
await waitForEventOnce(originalVideo, "timeupdate");
|
||||||
|
originalVideo.pause();
|
||||||
|
await waitForEventOnce(originalVideo, "pause");
|
||||||
|
|
||||||
|
ok(await assertVideosMatch(originalVideo, clone),
|
||||||
|
"Video with a poster should clone properly.");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
Загрузка…
Ссылка в новой задаче