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