Skip to content

Commit 6621a1e

Browse files
authored
WebKit export: Improve web platform test webvtt/rendering/cues-with-video/processing-model/enable_controls_reposition.html (#53817)
https://bugs.webkit.org/show_bug.cgi?id=295996
1 parent d4f254c commit 6621a1e

File tree

2 files changed

+55
-27
lines changed

2 files changed

+55
-27
lines changed
Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
11
<!DOCTYPE html>
2+
<html class="reftest-wait">
23
<title>Reference for WebVTT rendering, cue reposition after enabling controls</title>
34
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
45
<style>
5-
.video {
6-
display: inline-block;
7-
outline: solid;
8-
width: 320px;
9-
height: 240px;
10-
position: relative
11-
}
126
video {
137
position: absolute;
148
width:320px;
@@ -27,9 +21,32 @@
2721
color: green;
2822
font-size: 50px;
2923
}
24+
25+
.media-container {
26+
display: inline-block;
27+
position: relative;
28+
border: solid black 1px;
29+
border-box: content-box;
30+
width: 320px;
31+
height: 240px;
32+
}
3033
</style>
31-
<video controls>
32-
<source src="/media/white.webm" type="video/webm">
33-
<source src="/media/white.mp4" type="video/mp4">
34-
</video>
35-
<div class="video"><span class="cue"><span>Foo</span></span></div>
34+
<div class="media-container">
35+
<span class="cue"><span>Foo</span></span>
36+
<video controls autoplay onplaying="runTest()">
37+
<source src="/media/sound_5.mp3" type="audio/mp3">
38+
<source src="/media/sound_5.oga" type="audio/ogg">
39+
</video>
40+
</div>
41+
<script src="/common/reftest-wait.js"></script>
42+
<script>
43+
async function runTest() {
44+
let media = document.getElementsByTagName("video")[0];
45+
media.pause();
46+
media.currentTime = 0;
47+
media.addEventListener("seeked", (event) => {
48+
takeScreenshot();
49+
});
50+
}
51+
</script>
52+
</html>

webvtt/rendering/cues-with-video/processing-model/enable_controls_reposition.html

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
66
<style>
77
video {
8-
outline: solid;
98
width: 320px;
109
height: 240px;
1110
}
@@ -14,19 +13,31 @@
1413
font-size: 50px;
1514
color: green;
1615
}
16+
.media-container {
17+
display: inline-block;
18+
position: relative;
19+
border: solid black 1px;
20+
border-box: content-box;
21+
width: 320px;
22+
height: 240px;
23+
}
1724
</style>
18-
<script src="/common/reftest-wait.js"></script>
19-
<video autoplay onplaying="this.onplaying = null;
20-
this.pause();
21-
this.currentTime = 0;
22-
setTimeout(function(video){
23-
video.controls = true;
24-
}, 100, this);
25-
takeScreenshotDelayed(1000);">
26-
<source src="/media/white.webm" type="video/webm">
27-
<source src="/media/white.mp4" type="video/mp4">
28-
<track src=support/foo.vtt>
29-
<script>
30-
document.getElementsByTagName('track')[0].track.mode = 'showing';
31-
</script>
25+
<div class="media-container">
26+
<video controls autoplay onplaying="runTest()">
27+
<source src="/media/sound_5.mp3" type="audio/mp3">
28+
<source src="/media/sound_5.oga" type="audio/ogg">
29+
<track src="support/foo.vtt">
3230
</video>
31+
</div>
32+
<script src="/common/reftest-wait.js"></script>
33+
<script>
34+
async function runTest() {
35+
document.getElementsByTagName("track")[0].track.mode = "showing";
36+
let media = document.getElementsByTagName("video")[0];
37+
media.pause();
38+
media.currentTime = 0;
39+
media.addEventListener("seeked", (event) => {
40+
takeScreenshot();
41+
});
42+
}
43+
</script>

0 commit comments

Comments
 (0)