OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <meta charset="utf-8"> | 2 <meta charset="utf-8"> |
3 <title>idlharness test: Encoding Living Standard API</title> | 3 <title>idlharness test: Encoding Living Standard API</title> |
4 <link rel="author" title="Joshua Bell" href="mailto:jsbell@google.com" /> | 4 <link rel="author" title="Joshua Bell" href="mailto:jsbell@google.com" /> |
5 <link rel="help" href="https://encoding.spec.whatwg.org/#api"/> | 5 <link rel="help" href="https://encoding.spec.whatwg.org/#api"/> |
6 <script src="../../../resources/testharness.js"></script> | 6 <script src="../../../resources/testharness.js"></script> |
7 <script src="../../../resources/testharnessreport.js"></script> | 7 <script src="../../../resources/testharnessreport.js"></script> |
8 <script src="../../../resources/WebIDLParser.js"></script> | 8 <script src="../../../resources/WebIDLParser.js"></script> |
9 <script src="../../../resources/idlharness.js"></script> | 9 <script src="../../../resources/idlharness.js"></script> |
10 | 10 |
(...skipping 20 matching lines...) Expand all Loading... |
31 Exposed=Window,Worker] | 31 Exposed=Window,Worker] |
32 interface TextDecoder { | 32 interface TextDecoder { |
33 readonly attribute DOMString encoding; | 33 readonly attribute DOMString encoding; |
34 readonly attribute boolean fatal; | 34 readonly attribute boolean fatal; |
35 readonly attribute boolean ignoreBOM; | 35 readonly attribute boolean ignoreBOM; |
36 USVString decode(optional BufferSource input, optional TextDecodeOptions optio
ns); | 36 USVString decode(optional BufferSource input, optional TextDecodeOptions optio
ns); |
37 }; | 37 }; |
38 | 38 |
39 // 8.2 Interface TextDecoder | 39 // 8.2 Interface TextDecoder |
40 | 40 |
41 [Constructor(optional DOMString utfLabel = "utf-8"), | 41 [Constructor, |
42 Exposed=Window,Worker] | 42 Exposed=Window,Worker] |
43 interface TextEncoder { | 43 interface TextEncoder { |
44 readonly attribute DOMString encoding; | 44 readonly attribute DOMString encoding; |
45 [NewObject] Uint8Array encode(optional USVString input = ""); | 45 [NewObject] Uint8Array encode(optional USVString input = ""); |
46 }; | 46 }; |
47 </script> | 47 </script> |
48 | 48 |
49 <script> | 49 <script> |
50 function select(selector) { | 50 function select(selector) { |
51 return [].slice.call(document.querySelectorAll(selector)) | 51 return [].slice.call(document.querySelectorAll(selector)) |
52 .map(function(e) { return e.textContent; }) | 52 .map(function(e) { return e.textContent; }) |
53 .join('\n\n'); | 53 .join('\n\n'); |
54 } | 54 } |
55 | 55 |
56 var idl = select('.idl') | 56 var idl = select('.idl') |
57 var untested = select('.untested-idl'); | 57 var untested = select('.untested-idl'); |
58 var idl_array = new IdlArray(); | 58 var idl_array = new IdlArray(); |
59 idl_array.add_untested_idls(untested); | 59 idl_array.add_untested_idls(untested); |
60 idl_array.add_idls(idl); | 60 idl_array.add_idls(idl); |
61 idl_array.add_objects({ | 61 idl_array.add_objects({ |
62 TextEncoder: ['new TextEncoder()'], | 62 TextEncoder: ['new TextEncoder()'], |
63 TextDecoder: ['new TextDecoder()'] | 63 TextDecoder: ['new TextDecoder()'] |
64 }); | 64 }); |
65 idl_array.test(); | 65 idl_array.test(); |
66 </script> | 66 </script> |
OLD | NEW |