script: Implement TextEncoder::encodeInto() (#33360)

* Implement TextEncoder::encodeInto()

Signed-off-by: webbeef <me@webbeef.org>

* Update components/script/dom/textencoder.rs

Signed-off-by: Martin Robinson <mrobinson@igalia.com>

* Update components/script/dom/textencoder.rs

Signed-off-by: Martin Robinson <mrobinson@igalia.com>

---------

Signed-off-by: webbeef <me@webbeef.org>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
webbeef 2024-09-09 07:40:12 -07:00 committed by GitHub
parent 52a447b1e3
commit a3a86d5913
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 66 additions and 280 deletions

View file

@ -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