Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that disables it given conditions:
- os == "android" : https://bugzilla.mozilla.org/show_bug.cgi?id=1536762
- This WPT test may be referenced by the following Test IDs:
- /html/semantics/embedded-content/media-elements/track/track-element/track-cue-rendering-after-controls-removed.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<html class="reftest-wait">
<script src="/common/reftest-wait.js"></script>
<link rel="match" href="track-cue-rendering-after-controls-removed-ref.html">
<title>Text track cue layout after controls are removed</title>
<style>
::cue {
font-size: 50px;
}
</style>
<video controls style="border:1px solid gray">
<source src="/media/white.webm" type="video/webm">
<source src="/media/white.mp4" type="video/mp4">
</video>
<script>
// Add a cue that will overlap with the video controls.
var video = document.querySelector("video");
var track = video.addTextTrack("captions");
track.addCue(new VTTCue(0, 1, "text"));
track.mode = "showing";
video.onloadeddata = function() {
// Double nesting of requestAnimationFrame to
// make sure cue layout and paint happens.
window.requestAnimationFrame(function() {
window.requestAnimationFrame(function() {
// Remove the controls. The cue should not move.
video.controls = false;
takeScreenshot();
});
});
};
</script>
</html>