Source code

Revision control

Copy as Markdown

Other Tools

Test Info: Warnings

<!DOCTYPE html>
<html class="reftest-wait">
<script src="/common/reftest-wait.js"></script>
<link rel="match" href="track-cue-rendering-line-doesnt-fit-ref.html">
<script>
function addCue(track, cueData) {
var cue = new VTTCue(0, 10, 'XXX');
for (var prop in cueData)
cue[prop] = cueData[prop];
track.addCue(cue);
}
</script>
<style>
video::cue {
font-size: 120px;
color: green;
background-color: green;
}
</style>
<video autoplay onplaying="this.onplaying = null; this.pause(); takeScreenshot();">
<source src="/media/white.webm" type="video/webm">
<source src="/media/white.mp4" type="video/mp4">
<script>
var video = document.querySelector("video");
var track = video.addTextTrack('subtitles');
addCue(track, { line: 0, align: 'start', text: 'PAS' });
// This cue will not fit, and will not be displayed.
addCue(track, { line: 1, align: 'start', text: 'FAI' });
track.mode = 'showing';
</script>
</video>
</html>