width.html (774B)
1 <!doctype html> 2 <title>VTTRegion.width</title> 3 <link rel="help" href="https://w3c.github.io/webvtt/#dom-vttregion-width"> 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 region = new VTTRegion(); 10 assert_true('width' in region, 'width is not supported'); 11 12 for (var i = 0; i <= 100; i++) { 13 region.width = i; 14 assert_equals(region.width, i); 15 } 16 17 region.width = 1.5; 18 assert_equals(region.width, 1.5); 19 20 [-1, -100, -150, 101, 200, 250].forEach(function (invalid) { 21 assert_throws_dom('IndexSizeError', function() { 22 region.width = invalid; 23 }); 24 }); 25 }, document.title + ' script-created region'); 26 </script>