diff --git a/components/script/dom/textencoder.rs b/components/script/dom/textencoder.rs index 9354330af09..5e74177de9a 100644 --- a/components/script/dom/textencoder.rs +++ b/components/script/dom/textencoder.rs @@ -5,12 +5,16 @@ use std::ptr; use dom_struct::dom_struct; +use js::gc::CustomAutoRooterGuard; use js::jsapi::JSObject; use js::rust::HandleObject; +use js::typedarray; use js::typedarray::Uint8Array; use crate::dom::bindings::buffer_source::create_buffer_source; -use crate::dom::bindings::codegen::Bindings::TextEncoderBinding::TextEncoderMethods; +use crate::dom::bindings::codegen::Bindings::TextEncoderBinding::{ + TextEncoderEncodeIntoResult, TextEncoderMethods, +}; use crate::dom::bindings::error::Fallible; use crate::dom::bindings::reflector::{reflect_dom_object_with_proto, Reflector}; use crate::dom::bindings::root::DomRoot; @@ -43,7 +47,7 @@ impl TextEncoder { ) } - // https://encoding.spec.whatwg.org/#dom-textencoder + /// #[allow(non_snake_case)] pub fn Constructor( global: &GlobalScope, @@ -55,12 +59,12 @@ impl TextEncoder { } impl TextEncoderMethods for TextEncoder { - // https://encoding.spec.whatwg.org/#dom-textencoder-encoding + /// fn Encoding(&self) -> DOMString { DOMString::from("utf-8") } - // https://encoding.spec.whatwg.org/#dom-textencoder-encode + /// fn Encode(&self, cx: JSContext, input: USVString) -> Uint8Array { let encoded = input.0.as_bytes(); @@ -68,4 +72,55 @@ impl TextEncoderMethods for TextEncoder { create_buffer_source(cx, encoded, js_object.handle_mut()) .expect("Converting input to uint8 array should never fail") } + + /// + #[allow(unsafe_code)] + fn EncodeInto( + &self, + source: USVString, + mut destination: CustomAutoRooterGuard, + ) -> TextEncoderEncodeIntoResult { + let available = destination.len(); + + // Bail out if the destination has no space available. + if available == 0 { + return TextEncoderEncodeIntoResult { + read: Some(0), + written: Some(0), + }; + } + + let mut read = 0; + let mut written = 0; + + let dest = unsafe { destination.as_mut_slice() }; + + // Step 3, 4, 5, 6 + // Turn the source into a queue of scalar values. + // Iterate over the source values. + for result in source.0.chars() { + let utf8_len = result.len_utf8(); + if available - written >= utf8_len { + // Step 6.4.1 + // If destination’s byte length − written is greater than or equal to the number of bytes in result + read += if result > '\u{FFFF}' { 2 } else { 1 }; + + // Write the bytes in result into destination, with startingOffset set to written. + let target = &mut dest[written..written + utf8_len]; + result.encode_utf8(target); + + // Increment written by the number of bytes in result. + written += utf8_len; + } else { + // Step 6.4.2 + // Bail out when destination buffer is full. + break; + } + } + + TextEncoderEncodeIntoResult { + read: Some(read), + written: Some(written as _), + } + } } diff --git a/components/script/dom/webidls/TextEncoder.webidl b/components/script/dom/webidls/TextEncoder.webidl index 77e5132ff05..7028bb19172 100644 --- a/components/script/dom/webidls/TextEncoder.webidl +++ b/components/script/dom/webidls/TextEncoder.webidl @@ -3,10 +3,17 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /* https://encoding.spec.whatwg.org/#interface-textencoder */ + +dictionary TextEncoderEncodeIntoResult { + unsigned long long read; + unsigned long long written; +}; + [Exposed=(Window,Worker)] interface TextEncoder { [Throws] constructor(); readonly attribute DOMString encoding; [NewObject] Uint8Array encode(optional USVString input = ""); + TextEncoderEncodeIntoResult encodeInto(USVString source, [AllowShared] Uint8Array destination); }; diff --git a/tests/wpt/meta/encoding/encodeInto.any.js.ini b/tests/wpt/meta/encoding/encodeInto.any.js.ini index d8325f5f018..1c1b773a62f 100644 --- a/tests/wpt/meta/encoding/encodeInto.any.js.ini +++ b/tests/wpt/meta/encoding/encodeInto.any.js.ini @@ -1,253 +1,127 @@ [encodeInto.any.html] - [encodeInto() into ArrayBuffer with Hi and destination length 0, offset 0, filler 0] - expected: FAIL - [encodeInto() into SharedArrayBuffer with Hi and destination length 0, offset 0, filler 0] expected: FAIL - [encodeInto() into ArrayBuffer with Hi and destination length 0, offset 4, filler 0] - expected: FAIL - [encodeInto() into SharedArrayBuffer with Hi and destination length 0, offset 4, filler 0] expected: FAIL - [encodeInto() into ArrayBuffer with Hi and destination length 0, offset 0, filler 128] - expected: FAIL - [encodeInto() into SharedArrayBuffer with Hi and destination length 0, offset 0, filler 128] expected: FAIL - [encodeInto() into ArrayBuffer with Hi and destination length 0, offset 4, filler 128] - expected: FAIL - [encodeInto() into SharedArrayBuffer with Hi and destination length 0, offset 4, filler 128] expected: FAIL - [encodeInto() into ArrayBuffer with Hi and destination length 0, offset 0, filler random] - expected: FAIL - [encodeInto() into SharedArrayBuffer with Hi and destination length 0, offset 0, filler random] expected: FAIL - [encodeInto() into ArrayBuffer with Hi and destination length 0, offset 4, filler random] - expected: FAIL - [encodeInto() into SharedArrayBuffer with Hi and destination length 0, offset 4, filler random] expected: FAIL - [encodeInto() into ArrayBuffer with A and destination length 10, offset 0, filler 0] - expected: FAIL - [encodeInto() into SharedArrayBuffer with A and destination length 10, offset 0, filler 0] expected: FAIL - [encodeInto() into ArrayBuffer with A and destination length 10, offset 4, filler 0] - expected: FAIL - [encodeInto() into SharedArrayBuffer with A and destination length 10, offset 4, filler 0] expected: FAIL - [encodeInto() into ArrayBuffer with A and destination length 10, offset 0, filler 128] - expected: FAIL - [encodeInto() into SharedArrayBuffer with A and destination length 10, offset 0, filler 128] expected: FAIL - [encodeInto() into ArrayBuffer with A and destination length 10, offset 4, filler 128] - expected: FAIL - [encodeInto() into SharedArrayBuffer with A and destination length 10, offset 4, filler 128] expected: FAIL - [encodeInto() into ArrayBuffer with A and destination length 10, offset 0, filler random] - expected: FAIL - [encodeInto() into SharedArrayBuffer with A and destination length 10, offset 0, filler random] expected: FAIL - [encodeInto() into ArrayBuffer with A and destination length 10, offset 4, filler random] - expected: FAIL - [encodeInto() into SharedArrayBuffer with A and destination length 10, offset 4, filler random] expected: FAIL - [encodeInto() into ArrayBuffer with 𝌆 and destination length 4, offset 0, filler 0] - expected: FAIL - [encodeInto() into SharedArrayBuffer with 𝌆 and destination length 4, offset 0, filler 0] expected: FAIL - [encodeInto() into ArrayBuffer with 𝌆 and destination length 4, offset 4, filler 0] - expected: FAIL - [encodeInto() into SharedArrayBuffer with 𝌆 and destination length 4, offset 4, filler 0] expected: FAIL - [encodeInto() into ArrayBuffer with 𝌆 and destination length 4, offset 0, filler 128] - expected: FAIL - [encodeInto() into SharedArrayBuffer with 𝌆 and destination length 4, offset 0, filler 128] expected: FAIL - [encodeInto() into ArrayBuffer with 𝌆 and destination length 4, offset 4, filler 128] - expected: FAIL - [encodeInto() into SharedArrayBuffer with 𝌆 and destination length 4, offset 4, filler 128] expected: FAIL - [encodeInto() into ArrayBuffer with 𝌆 and destination length 4, offset 0, filler random] - expected: FAIL - [encodeInto() into SharedArrayBuffer with 𝌆 and destination length 4, offset 0, filler random] expected: FAIL - [encodeInto() into ArrayBuffer with 𝌆 and destination length 4, offset 4, filler random] - expected: FAIL - [encodeInto() into SharedArrayBuffer with 𝌆 and destination length 4, offset 4, filler random] expected: FAIL - [encodeInto() into ArrayBuffer with 𝌆A and destination length 3, offset 0, filler 0] - expected: FAIL - [encodeInto() into SharedArrayBuffer with 𝌆A and destination length 3, offset 0, filler 0] expected: FAIL - [encodeInto() into ArrayBuffer with 𝌆A and destination length 3, offset 4, filler 0] - expected: FAIL - [encodeInto() into SharedArrayBuffer with 𝌆A and destination length 3, offset 4, filler 0] expected: FAIL - [encodeInto() into ArrayBuffer with 𝌆A and destination length 3, offset 0, filler 128] - expected: FAIL - [encodeInto() into SharedArrayBuffer with 𝌆A and destination length 3, offset 0, filler 128] expected: FAIL - [encodeInto() into ArrayBuffer with 𝌆A and destination length 3, offset 4, filler 128] - expected: FAIL - [encodeInto() into SharedArrayBuffer with 𝌆A and destination length 3, offset 4, filler 128] expected: FAIL - [encodeInto() into ArrayBuffer with 𝌆A and destination length 3, offset 0, filler random] - expected: FAIL - [encodeInto() into SharedArrayBuffer with 𝌆A and destination length 3, offset 0, filler random] expected: FAIL - [encodeInto() into ArrayBuffer with 𝌆A and destination length 3, offset 4, filler random] - expected: FAIL - [encodeInto() into SharedArrayBuffer with 𝌆A and destination length 3, offset 4, filler random] expected: FAIL - [encodeInto() into ArrayBuffer with U+d834AU+df06A¥Hi and destination length 10, offset 0, filler 0] - expected: FAIL - [encodeInto() into SharedArrayBuffer with U+d834AU+df06A¥Hi and destination length 10, offset 0, filler 0] expected: FAIL - [encodeInto() into ArrayBuffer with U+d834AU+df06A¥Hi and destination length 10, offset 4, filler 0] - expected: FAIL - [encodeInto() into SharedArrayBuffer with U+d834AU+df06A¥Hi and destination length 10, offset 4, filler 0] expected: FAIL - [encodeInto() into ArrayBuffer with U+d834AU+df06A¥Hi and destination length 10, offset 0, filler 128] - expected: FAIL - [encodeInto() into SharedArrayBuffer with U+d834AU+df06A¥Hi and destination length 10, offset 0, filler 128] expected: FAIL - [encodeInto() into ArrayBuffer with U+d834AU+df06A¥Hi and destination length 10, offset 4, filler 128] - expected: FAIL - [encodeInto() into SharedArrayBuffer with U+d834AU+df06A¥Hi and destination length 10, offset 4, filler 128] expected: FAIL - [encodeInto() into ArrayBuffer with U+d834AU+df06A¥Hi and destination length 10, offset 0, filler random] - expected: FAIL - [encodeInto() into SharedArrayBuffer with U+d834AU+df06A¥Hi and destination length 10, offset 0, filler random] expected: FAIL - [encodeInto() into ArrayBuffer with U+d834AU+df06A¥Hi and destination length 10, offset 4, filler random] - expected: FAIL - [encodeInto() into SharedArrayBuffer with U+d834AU+df06A¥Hi and destination length 10, offset 4, filler random] expected: FAIL - [encodeInto() into ArrayBuffer with AU+df06 and destination length 4, offset 0, filler 0] - expected: FAIL - [encodeInto() into SharedArrayBuffer with AU+df06 and destination length 4, offset 0, filler 0] expected: FAIL - [encodeInto() into ArrayBuffer with AU+df06 and destination length 4, offset 4, filler 0] - expected: FAIL - [encodeInto() into SharedArrayBuffer with AU+df06 and destination length 4, offset 4, filler 0] expected: FAIL - [encodeInto() into ArrayBuffer with AU+df06 and destination length 4, offset 0, filler 128] - expected: FAIL - [encodeInto() into SharedArrayBuffer with AU+df06 and destination length 4, offset 0, filler 128] expected: FAIL - [encodeInto() into ArrayBuffer with AU+df06 and destination length 4, offset 4, filler 128] - expected: FAIL - [encodeInto() into SharedArrayBuffer with AU+df06 and destination length 4, offset 4, filler 128] expected: FAIL - [encodeInto() into ArrayBuffer with AU+df06 and destination length 4, offset 0, filler random] - expected: FAIL - [encodeInto() into SharedArrayBuffer with AU+df06 and destination length 4, offset 0, filler random] expected: FAIL - [encodeInto() into ArrayBuffer with AU+df06 and destination length 4, offset 4, filler random] - expected: FAIL - [encodeInto() into SharedArrayBuffer with AU+df06 and destination length 4, offset 4, filler random] expected: FAIL - [encodeInto() into ArrayBuffer with ¥¥ and destination length 4, offset 0, filler 0] - expected: FAIL - [encodeInto() into SharedArrayBuffer with ¥¥ and destination length 4, offset 0, filler 0] expected: FAIL - [encodeInto() into ArrayBuffer with ¥¥ and destination length 4, offset 4, filler 0] - expected: FAIL - [encodeInto() into SharedArrayBuffer with ¥¥ and destination length 4, offset 4, filler 0] expected: FAIL - [encodeInto() into ArrayBuffer with ¥¥ and destination length 4, offset 0, filler 128] - expected: FAIL - [encodeInto() into SharedArrayBuffer with ¥¥ and destination length 4, offset 0, filler 128] expected: FAIL - [encodeInto() into ArrayBuffer with ¥¥ and destination length 4, offset 4, filler 128] - expected: FAIL - [encodeInto() into SharedArrayBuffer with ¥¥ and destination length 4, offset 4, filler 128] expected: FAIL - [encodeInto() into ArrayBuffer with ¥¥ and destination length 4, offset 0, filler random] - expected: FAIL - [encodeInto() into SharedArrayBuffer with ¥¥ and destination length 4, offset 0, filler random] expected: FAIL - [encodeInto() into ArrayBuffer with ¥¥ and destination length 4, offset 4, filler random] - expected: FAIL - [encodeInto() into SharedArrayBuffer with ¥¥ and destination length 4, offset 4, filler random] expected: FAIL @@ -284,9 +158,6 @@ [Invalid encodeInto() destination: Float64Array, backed by: SharedArrayBuffer] expected: FAIL - [encodeInto() and a detached output buffer] - expected: FAIL - [Invalid encodeInto() destination: Float16Array, backed by: ArrayBuffer] expected: FAIL @@ -298,255 +169,129 @@ expected: ERROR [encodeInto.any.worker.html] - [encodeInto() into ArrayBuffer with Hi and destination length 0, offset 0, filler 0] - expected: FAIL - [encodeInto() into SharedArrayBuffer with Hi and destination length 0, offset 0, filler 0] expected: FAIL - [encodeInto() into ArrayBuffer with Hi and destination length 0, offset 4, filler 0] - expected: FAIL - [encodeInto() into SharedArrayBuffer with Hi and destination length 0, offset 4, filler 0] expected: FAIL - [encodeInto() into ArrayBuffer with Hi and destination length 0, offset 0, filler 128] - expected: FAIL - [encodeInto() into SharedArrayBuffer with Hi and destination length 0, offset 0, filler 128] expected: FAIL - [encodeInto() into ArrayBuffer with Hi and destination length 0, offset 4, filler 128] - expected: FAIL - [encodeInto() into SharedArrayBuffer with Hi and destination length 0, offset 4, filler 128] expected: FAIL - [encodeInto() into ArrayBuffer with Hi and destination length 0, offset 0, filler random] - expected: FAIL - [encodeInto() into SharedArrayBuffer with Hi and destination length 0, offset 0, filler random] expected: FAIL - [encodeInto() into ArrayBuffer with Hi and destination length 0, offset 4, filler random] - expected: FAIL - [encodeInto() into SharedArrayBuffer with Hi and destination length 0, offset 4, filler random] expected: FAIL - [encodeInto() into ArrayBuffer with A and destination length 10, offset 0, filler 0] - expected: FAIL - [encodeInto() into SharedArrayBuffer with A and destination length 10, offset 0, filler 0] expected: FAIL - [encodeInto() into ArrayBuffer with A and destination length 10, offset 4, filler 0] - expected: FAIL - [encodeInto() into SharedArrayBuffer with A and destination length 10, offset 4, filler 0] expected: FAIL - [encodeInto() into ArrayBuffer with A and destination length 10, offset 0, filler 128] - expected: FAIL - [encodeInto() into SharedArrayBuffer with A and destination length 10, offset 0, filler 128] expected: FAIL - [encodeInto() into ArrayBuffer with A and destination length 10, offset 4, filler 128] - expected: FAIL - [encodeInto() into SharedArrayBuffer with A and destination length 10, offset 4, filler 128] expected: FAIL - [encodeInto() into ArrayBuffer with A and destination length 10, offset 0, filler random] - expected: FAIL - [encodeInto() into SharedArrayBuffer with A and destination length 10, offset 0, filler random] expected: FAIL - [encodeInto() into ArrayBuffer with A and destination length 10, offset 4, filler random] - expected: FAIL - [encodeInto() into SharedArrayBuffer with A and destination length 10, offset 4, filler random] expected: FAIL - [encodeInto() into ArrayBuffer with 𝌆 and destination length 4, offset 0, filler 0] - expected: FAIL - [encodeInto() into SharedArrayBuffer with 𝌆 and destination length 4, offset 0, filler 0] expected: FAIL - [encodeInto() into ArrayBuffer with 𝌆 and destination length 4, offset 4, filler 0] - expected: FAIL - [encodeInto() into SharedArrayBuffer with 𝌆 and destination length 4, offset 4, filler 0] expected: FAIL - [encodeInto() into ArrayBuffer with 𝌆 and destination length 4, offset 0, filler 128] - expected: FAIL - [encodeInto() into SharedArrayBuffer with 𝌆 and destination length 4, offset 0, filler 128] expected: FAIL - [encodeInto() into ArrayBuffer with 𝌆 and destination length 4, offset 4, filler 128] - expected: FAIL - [encodeInto() into SharedArrayBuffer with 𝌆 and destination length 4, offset 4, filler 128] expected: FAIL - [encodeInto() into ArrayBuffer with 𝌆 and destination length 4, offset 0, filler random] - expected: FAIL - [encodeInto() into SharedArrayBuffer with 𝌆 and destination length 4, offset 0, filler random] expected: FAIL - [encodeInto() into ArrayBuffer with 𝌆 and destination length 4, offset 4, filler random] - expected: FAIL - [encodeInto() into SharedArrayBuffer with 𝌆 and destination length 4, offset 4, filler random] expected: FAIL - [encodeInto() into ArrayBuffer with 𝌆A and destination length 3, offset 0, filler 0] - expected: FAIL - [encodeInto() into SharedArrayBuffer with 𝌆A and destination length 3, offset 0, filler 0] expected: FAIL - [encodeInto() into ArrayBuffer with 𝌆A and destination length 3, offset 4, filler 0] - expected: FAIL - [encodeInto() into SharedArrayBuffer with 𝌆A and destination length 3, offset 4, filler 0] expected: FAIL - [encodeInto() into ArrayBuffer with 𝌆A and destination length 3, offset 0, filler 128] - expected: FAIL - [encodeInto() into SharedArrayBuffer with 𝌆A and destination length 3, offset 0, filler 128] expected: FAIL - [encodeInto() into ArrayBuffer with 𝌆A and destination length 3, offset 4, filler 128] - expected: FAIL - [encodeInto() into SharedArrayBuffer with 𝌆A and destination length 3, offset 4, filler 128] expected: FAIL - [encodeInto() into ArrayBuffer with 𝌆A and destination length 3, offset 0, filler random] - expected: FAIL - [encodeInto() into SharedArrayBuffer with 𝌆A and destination length 3, offset 0, filler random] expected: FAIL - [encodeInto() into ArrayBuffer with 𝌆A and destination length 3, offset 4, filler random] - expected: FAIL - [encodeInto() into SharedArrayBuffer with 𝌆A and destination length 3, offset 4, filler random] expected: FAIL - [encodeInto() into ArrayBuffer with U+d834AU+df06A¥Hi and destination length 10, offset 0, filler 0] - expected: FAIL - [encodeInto() into SharedArrayBuffer with U+d834AU+df06A¥Hi and destination length 10, offset 0, filler 0] expected: FAIL - [encodeInto() into ArrayBuffer with U+d834AU+df06A¥Hi and destination length 10, offset 4, filler 0] - expected: FAIL - [encodeInto() into SharedArrayBuffer with U+d834AU+df06A¥Hi and destination length 10, offset 4, filler 0] expected: FAIL - [encodeInto() into ArrayBuffer with U+d834AU+df06A¥Hi and destination length 10, offset 0, filler 128] - expected: FAIL - [encodeInto() into SharedArrayBuffer with U+d834AU+df06A¥Hi and destination length 10, offset 0, filler 128] expected: FAIL - [encodeInto() into ArrayBuffer with U+d834AU+df06A¥Hi and destination length 10, offset 4, filler 128] - expected: FAIL - [encodeInto() into SharedArrayBuffer with U+d834AU+df06A¥Hi and destination length 10, offset 4, filler 128] expected: FAIL - [encodeInto() into ArrayBuffer with U+d834AU+df06A¥Hi and destination length 10, offset 0, filler random] - expected: FAIL - [encodeInto() into SharedArrayBuffer with U+d834AU+df06A¥Hi and destination length 10, offset 0, filler random] expected: FAIL - [encodeInto() into ArrayBuffer with U+d834AU+df06A¥Hi and destination length 10, offset 4, filler random] - expected: FAIL - [encodeInto() into SharedArrayBuffer with U+d834AU+df06A¥Hi and destination length 10, offset 4, filler random] expected: FAIL - [encodeInto() into ArrayBuffer with AU+df06 and destination length 4, offset 0, filler 0] - expected: FAIL - [encodeInto() into SharedArrayBuffer with AU+df06 and destination length 4, offset 0, filler 0] expected: FAIL - [encodeInto() into ArrayBuffer with AU+df06 and destination length 4, offset 4, filler 0] - expected: FAIL - [encodeInto() into SharedArrayBuffer with AU+df06 and destination length 4, offset 4, filler 0] expected: FAIL - [encodeInto() into ArrayBuffer with AU+df06 and destination length 4, offset 0, filler 128] - expected: FAIL - [encodeInto() into SharedArrayBuffer with AU+df06 and destination length 4, offset 0, filler 128] expected: FAIL - [encodeInto() into ArrayBuffer with AU+df06 and destination length 4, offset 4, filler 128] - expected: FAIL - [encodeInto() into SharedArrayBuffer with AU+df06 and destination length 4, offset 4, filler 128] expected: FAIL - [encodeInto() into ArrayBuffer with AU+df06 and destination length 4, offset 0, filler random] - expected: FAIL - [encodeInto() into SharedArrayBuffer with AU+df06 and destination length 4, offset 0, filler random] expected: FAIL - [encodeInto() into ArrayBuffer with AU+df06 and destination length 4, offset 4, filler random] - expected: FAIL - [encodeInto() into SharedArrayBuffer with AU+df06 and destination length 4, offset 4, filler random] expected: FAIL - [encodeInto() into ArrayBuffer with ¥¥ and destination length 4, offset 0, filler 0] - expected: FAIL - [encodeInto() into SharedArrayBuffer with ¥¥ and destination length 4, offset 0, filler 0] expected: FAIL - [encodeInto() into ArrayBuffer with ¥¥ and destination length 4, offset 4, filler 0] - expected: FAIL - [encodeInto() into SharedArrayBuffer with ¥¥ and destination length 4, offset 4, filler 0] expected: FAIL - [encodeInto() into ArrayBuffer with ¥¥ and destination length 4, offset 0, filler 128] - expected: FAIL - [encodeInto() into SharedArrayBuffer with ¥¥ and destination length 4, offset 0, filler 128] expected: FAIL - [encodeInto() into ArrayBuffer with ¥¥ and destination length 4, offset 4, filler 128] - expected: FAIL - [encodeInto() into SharedArrayBuffer with ¥¥ and destination length 4, offset 4, filler 128] expected: FAIL - [encodeInto() into ArrayBuffer with ¥¥ and destination length 4, offset 0, filler random] - expected: FAIL - [encodeInto() into SharedArrayBuffer with ¥¥ and destination length 4, offset 0, filler random] expected: FAIL - [encodeInto() into ArrayBuffer with ¥¥ and destination length 4, offset 4, filler random] - expected: FAIL - [encodeInto() into SharedArrayBuffer with ¥¥ and destination length 4, offset 4, filler random] expected: FAIL @@ -583,9 +328,6 @@ [Invalid encodeInto() destination: Float64Array, backed by: SharedArrayBuffer] expected: FAIL - [encodeInto() and a detached output buffer] - expected: FAIL - [Invalid encodeInto() destination: Float16Array, backed by: ArrayBuffer] expected: FAIL diff --git a/tests/wpt/meta/encoding/idlharness.any.js.ini b/tests/wpt/meta/encoding/idlharness.any.js.ini index dfb64d2eed4..e63ee258be9 100644 --- a/tests/wpt/meta/encoding/idlharness.any.js.ini +++ b/tests/wpt/meta/encoding/idlharness.any.js.ini @@ -5,15 +5,6 @@ expected: ERROR [idlharness.any.html] - [TextEncoder interface: operation encodeInto(USVString, Uint8Array)] - expected: FAIL - - [TextEncoder interface: new TextEncoder() must inherit property "encodeInto(USVString, Uint8Array)" with the proper type] - expected: FAIL - - [TextEncoder interface: calling encodeInto(USVString, Uint8Array) on new TextEncoder() with too few arguments must throw TypeError] - expected: FAIL - [TextDecoderStream interface: existence and properties of interface object] expected: FAIL @@ -64,15 +55,6 @@ [idlharness.any.worker.html] - [TextEncoder interface: operation encodeInto(USVString, Uint8Array)] - expected: FAIL - - [TextEncoder interface: new TextEncoder() must inherit property "encodeInto(USVString, Uint8Array)" with the proper type] - expected: FAIL - - [TextEncoder interface: calling encodeInto(USVString, Uint8Array) on new TextEncoder() with too few arguments must throw TypeError] - expected: FAIL - [TextDecoderStream interface: existence and properties of interface object] expected: FAIL