mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Update webidl files for TextEncoder and TextDecoder (#37952)
This PR updates the webidl files for `TextEncoder` and `TextDecoder`. For `TextDecoder.webidl`, the type `AllowSharedBufferSource`, as defined in the latest spec, is replaced with `BufferSource` as servo currently does not support `ShareArrayBuffer` Testing: This update does not introduce any change to the generated rust binding, so the existing testing would suffice --------- Signed-off-by: Minghua Wu <michael.wu1107@gmail.com> Signed-off-by: Xiaocheng Hu <xiaochengh.work@gmail.com> Co-authored-by: Xiaocheng Hu <xiaochengh.work@gmail.com>
This commit is contained in:
parent
4cddd5fd5e
commit
562d9e4a21
4 changed files with 26 additions and 6 deletions
|
@ -12,12 +12,11 @@ dictionary TextDecodeOptions {
|
||||||
boolean stream = false;
|
boolean stream = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
[Exposed=(Window,Worker)]
|
[Exposed=*]
|
||||||
interface TextDecoder {
|
interface TextDecoder {
|
||||||
[Throws] constructor(optional DOMString label = "utf-8", optional TextDecoderOptions options = {});
|
[Throws] constructor(optional DOMString label = "utf-8", optional TextDecoderOptions options = {});
|
||||||
readonly attribute DOMString encoding;
|
|
||||||
readonly attribute boolean fatal;
|
|
||||||
readonly attribute boolean ignoreBOM;
|
|
||||||
[Throws]
|
[Throws]
|
||||||
USVString decode(optional BufferSource input, optional TextDecodeOptions options = {});
|
USVString decode(optional BufferSource input, optional TextDecodeOptions options = {});
|
||||||
};
|
};
|
||||||
|
TextDecoder includes TextDecoderCommon;
|
||||||
|
|
11
components/script_bindings/webidls/TextDecoderCommon.webidl
Normal file
11
components/script_bindings/webidls/TextDecoderCommon.webidl
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
|
// https://encoding.spec.whatwg.org/#textdecodercommon
|
||||||
|
|
||||||
|
interface mixin TextDecoderCommon {
|
||||||
|
readonly attribute DOMString encoding;
|
||||||
|
readonly attribute boolean fatal;
|
||||||
|
readonly attribute boolean ignoreBOM;
|
||||||
|
};
|
|
@ -9,11 +9,12 @@ dictionary TextEncoderEncodeIntoResult {
|
||||||
unsigned long long written;
|
unsigned long long written;
|
||||||
};
|
};
|
||||||
|
|
||||||
[Exposed=(Window,Worker)]
|
[Exposed=*]
|
||||||
interface TextEncoder {
|
interface TextEncoder {
|
||||||
[Throws] constructor();
|
[Throws] constructor();
|
||||||
readonly attribute DOMString encoding;
|
|
||||||
[NewObject]
|
[NewObject]
|
||||||
Uint8Array encode(optional USVString input = "");
|
Uint8Array encode(optional USVString input = "");
|
||||||
TextEncoderEncodeIntoResult encodeInto(USVString source, [AllowShared] Uint8Array destination);
|
TextEncoderEncodeIntoResult encodeInto(USVString source, [AllowShared] Uint8Array destination);
|
||||||
};
|
};
|
||||||
|
TextEncoder includes TextEncoderCommon;
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
|
// https://encoding.spec.whatwg.org/#textencodercommon
|
||||||
|
|
||||||
|
interface mixin TextEncoderCommon {
|
||||||
|
readonly attribute DOMString encoding;
|
||||||
|
};
|
Loading…
Add table
Add a link
Reference in a new issue