tor-browser

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

region.html (1082B)


      1 <!doctype html>
      2 <title>VTTCue.region</title>
      3 <link rel="help" href="https://w3c.github.io/webvtt/#dom-vttcue-region">
      4 <script src=/resources/testharness.js></script>
      5 <script src=/resources/testharnessreport.js></script>
      6 <div id=log></div>
      7 <script>
      8 test(function(){
      9    var video = document.createElement('video');
     10    document.body.appendChild(video);
     11 
     12    var cue = new VTTCue(0, 1, 'text');
     13    assert_true('region' in cue, 'region is not supported');
     14    assert_equals(cue.region, null);
     15 
     16    var track = document.createElement('track');
     17    var t = track.track;
     18    t.addCue(cue);
     19 
     20    assert_equals(cue.region, null);
     21 
     22    video.appendChild(track);
     23    assert_equals(cue.region, null);
     24 
     25    t.mode = 'showing';
     26    assert_equals(cue.region, null);
     27 
     28    var region = new VTTRegion();
     29    cue.region = region;
     30    assert_equals(cue.region, region);
     31 
     32    assert_throws_js(TypeError, () => {
     33        cue.region = 'foo';
     34    });
     35    assert_equals(cue.region, region);
     36 
     37    cue.region = null;
     38    assert_equals(cue.region, null);
     39 }, document.title+', script-created cue');
     40 </script>