tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

vtt_reflow_display.html (1074B)


      1 <!DOCTYPE HTML>
      2 <html class="reftest-wait">
      3 <head>
      4 </head>
      5 <link rel="stylesheet" href="vtt_reflow_display.css">
      6 <body>
      7 <div class="video-player">
      8  <div class="video-layer">
      9    <video id="v1" autoplay controls></video>
     10  </div>
     11 </div>
     12 <script>
     13 /**
     14 * In bug 1733232, setting some CSS properties (from bug 1733232 comment17)
     15 * would cause video frame's reflow called very frequently, which crashed the
     16 * video control and caused no cue showing. We compare this test with another
     17 * white video without any cues, and they should NOT be equal.
     18 */
     19 function testDisplayCueDuringFrequentReflow() {
     20  let video = document.getElementById("v1");
     21  video.src = "white.webm";
     22  let cue = new VTTCue(0, 4, "hello testing");
     23  cue.onenter = _ => {
     24    cue.onenter = null;
     25    video.pause();
     26    document.documentElement.removeAttribute('class');
     27  }
     28  let track = video.addTextTrack("captions");
     29  track.mode = "showing";
     30  track.addCue(cue);
     31 };
     32 
     33 window.addEventListener("MozReftestInvalidate",
     34                        testDisplayCueDuringFrequentReflow);
     35 </script>
     36 </body>
     37 </html>