OLD | NEW |
(Empty) | |
| 1 <!doctype html> |
| 2 <title>WebVTT IDL tests</title> |
| 3 <script src=/resources/testharness.js></script> |
| 4 <script src=/resources/testharnessreport.js></script> |
| 5 <script src=/resources/WebIDLParser.js></script> |
| 6 <script src=/resources/idlharness.js></script> |
| 7 |
| 8 <h1>WebVTT IDL tests</h1> |
| 9 <div id=log></div> |
| 10 |
| 11 <script type=text/plain> |
| 12 enum AutoKeyword { "auto" }; |
| 13 enum DirectionSetting { "" /* horizontal */, "rl", "lr" }; |
| 14 enum AlignSetting { "start", "middle", "end", "left", "right" }; |
| 15 [Constructor(double startTime, double endTime, DOMString text)] |
| 16 interface VTTCue : TextTrackCue { |
| 17 attribute VTTRegion? region; |
| 18 attribute DirectionSetting vertical; |
| 19 attribute boolean snapToLines; |
| 20 attribute (double or AutoKeyword) line; |
| 21 attribute AlignSetting lineAlign; |
| 22 attribute (double or AutoKeyword) position; |
| 23 attribute AlignSetting positionAlign; |
| 24 attribute double size; |
| 25 attribute AlignSetting align; |
| 26 attribute DOMString text; |
| 27 DocumentFragment getCueAsHTML(); |
| 28 }; |
| 29 |
| 30 enum ScrollSetting { "" /* none */, "up" }; |
| 31 [Constructor] |
| 32 interface VTTRegion { |
| 33 attribute double width; |
| 34 attribute long lines; |
| 35 attribute double regionAnchorX; |
| 36 attribute double regionAnchorY; |
| 37 attribute double viewportAnchorX; |
| 38 attribute double viewportAnchorY; |
| 39 attribute ScrollSetting scroll; |
| 40 }; |
| 41 </script> |
| 42 <script> |
| 43 "use strict"; |
| 44 var idlArray; |
| 45 setup(function() { |
| 46 idlArray = new IdlArray(); |
| 47 [].forEach.call(document.querySelectorAll("script[type=text\\/plain]"),
function(node) { |
| 48 if (node.className == "untested") { |
| 49 idlArray.add_untested_idls(node.textContent); |
| 50 } else { |
| 51 idlArray.add_idls(node.textContent); |
| 52 } |
| 53 }); |
| 54 }, {explicit_done:true}); |
| 55 window.onload = function() { |
| 56 idlArray.add_objects({ |
| 57 // WebVTT |
| 58 VTTCue: ['new VTTCue(0, 1, "foo")'], |
| 59 VTTRegion: ['new VTTRegion()'] |
| 60 }); |
| 61 idlArray.test(); |
| 62 done(); |
| 63 }; |
| 64 </script> |
OLD | NEW |