Bug 1486949 - Part 5: Implement Text{Decoder,Encoder}Stream r=smaug

Differential Revision: https://phabricator.services.mozilla.com/D153782
This commit is contained in:
Kagami Sascha Rosylight 2022-08-12 15:59:05 +00:00
Родитель 237dffb194
Коммит 0c2f2d038f
29 изменённых файлов: 764 добавлений и 1711 удалений

Просмотреть файл

@ -44,8 +44,10 @@ void TextDecoder::InitWithEncoding(NotNull<const Encoding*> aEncoding,
}
}
void TextDecoder::Decode(Span<const uint8_t> aInput, const bool aStream,
nsAString& aOutDecodedString, ErrorResult& aRv) {
void TextDecoderCommon::DecodeNative(Span<const uint8_t> aInput,
const bool aStream,
nsAString& aOutDecodedString,
ErrorResult& aRv) {
aOutDecodedString.Truncate();
CheckedInt<nsAString::size_type> needed =
@ -99,7 +101,7 @@ void TextDecoder::Decode(const Optional<ArrayBufferViewOrArrayBuffer>& aBuffer,
const TextDecodeOptions& aOptions,
nsAString& aOutDecodedString, ErrorResult& aRv) {
if (!aBuffer.WasPassed()) {
Decode(nullptr, aOptions.mStream, aOutDecodedString, aRv);
DecodeNative(nullptr, aOptions.mStream, aOutDecodedString, aRv);
return;
}
const ArrayBufferViewOrArrayBuffer& buf = aBuffer.Value();
@ -115,10 +117,10 @@ void TextDecoder::Decode(const Optional<ArrayBufferViewOrArrayBuffer>& aBuffer,
data = buf.GetAsArrayBuffer().Data();
length = buf.GetAsArrayBuffer().Length();
}
Decode(Span(data, length), aOptions.mStream, aOutDecodedString, aRv);
DecodeNative(Span(data, length), aOptions.mStream, aOutDecodedString, aRv);
}
void TextDecoder::GetEncoding(nsAString& aEncoding) {
void TextDecoderCommon::GetEncoding(nsAString& aEncoding) {
CopyASCIItoUTF16(mEncoding, aEncoding);
nsContentUtils::ASCIIToLower(aEncoding);
}

Просмотреть файл

@ -18,7 +18,47 @@ namespace mozilla::dom {
class ArrayBufferViewOrArrayBuffer;
class TextDecoder final : public NonRefcountedDOMObject {
class TextDecoderCommon {
public:
/**
* Decodes incoming byte stream of characters in charset indicated by
* encoding.
*
* The encoding algorithm state is reset if aOptions.mStream is not set.
*
* If the fatal flag is set then a decoding error will throw EncodingError.
* Else the decoder will return a decoded string with replacement
* character(s) for unidentified character(s).
*
* @param aInput, incoming byte stream of characters to be decoded to
* to UTF-16 code points.
* @param aStream, indicates if streaming or not.
* @param aOutDecodedString, decoded string of UTF-16 code points.
* @param aRv, error result.
*/
void DecodeNative(mozilla::Span<const uint8_t> aInput, const bool aStream,
nsAString& aOutDecodedString, ErrorResult& aRv);
/**
* Return the encoding name.
*
* @param aEncoding, current encoding.
*/
void GetEncoding(nsAString& aEncoding);
bool Fatal() const { return mFatal; }
bool IgnoreBOM() const { return mIgnoreBOM; }
protected:
mozilla::UniquePtr<mozilla::Decoder> mDecoder;
nsCString mEncoding;
bool mFatal = false;
bool mIgnoreBOM = false;
};
class TextDecoder final : public NonRefcountedDOMObject,
public TextDecoderCommon {
public:
// The WebIDL constructor.
static TextDecoder* Constructor(const GlobalObject& aGlobal,
@ -33,9 +73,7 @@ class TextDecoder final : public NonRefcountedDOMObject {
return txtDecoder.release();
}
TextDecoder() : mFatal(false), mIgnoreBOM(false) {
MOZ_COUNT_CTOR(TextDecoder);
}
TextDecoder() { MOZ_COUNT_CTOR(TextDecoder); }
MOZ_COUNTED_DTOR(TextDecoder)
@ -64,45 +102,11 @@ class TextDecoder final : public NonRefcountedDOMObject {
void InitWithEncoding(NotNull<const Encoding*> aEncoding,
const TextDecoderOptions& aOptions);
/**
* Return the encoding name.
*
* @param aEncoding, current encoding.
*/
void GetEncoding(nsAString& aEncoding);
/**
* Decodes incoming byte stream of characters in charset indicated by
* encoding.
*
* The encoding algorithm state is reset if aOptions.mStream is not set.
*
* If the fatal flag is set then a decoding error will throw EncodingError.
* Else the decoder will return a decoded string with replacement
* character(s) for unidentified character(s).
*
* @param aView, incoming byte stream of characters to be decoded to
* to UTF-16 code points.
* @param aOptions, indicates if streaming or not.
* @param aOutDecodedString, decoded string of UTF-16 code points.
* @param aRv, error result.
*/
void Decode(mozilla::Span<const uint8_t> aInput, const bool aStream,
nsAString& aOutDecodedString, ErrorResult& aRv);
void Decode(const Optional<ArrayBufferViewOrArrayBuffer>& aBuffer,
const TextDecodeOptions& aOptions, nsAString& aOutDecodedString,
ErrorResult& aRv);
bool Fatal() const { return mFatal; }
bool IgnoreBOM() const { return mIgnoreBOM; }
private:
nsCString mEncoding;
mozilla::UniquePtr<mozilla::Decoder> mDecoder;
bool mFatal;
bool mIgnoreBOM;
};
} // namespace mozilla::dom

Просмотреть файл

@ -0,0 +1,245 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* 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 http://mozilla.org/MPL/2.0/. */
#include "mozilla/dom/TextDecoderStream.h"
#include "nsContentUtils.h"
#include "nsIGlobalObject.h"
#include "mozilla/Encoding.h"
#include "mozilla/dom/Promise.h"
#include "mozilla/dom/TextDecoderStreamBinding.h"
#include "mozilla/dom/TransformerCallbackHelpers.h"
#include "mozilla/dom/TransformStream.h"
#include "mozilla/dom/UnionTypes.h"
namespace mozilla::dom {
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(TextDecoderStream, mGlobal, mStream)
NS_IMPL_CYCLE_COLLECTING_ADDREF(TextDecoderStream)
NS_IMPL_CYCLE_COLLECTING_RELEASE(TextDecoderStream)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(TextDecoderStream)
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
NS_INTERFACE_MAP_ENTRY(nsISupports)
NS_INTERFACE_MAP_END
TextDecoderStream::TextDecoderStream(nsISupports* aGlobal,
const Encoding& aEncoding, bool aFatal,
bool aIgnoreBOM, TransformStream& aStream)
: mGlobal(aGlobal), mStream(&aStream) {
mFatal = aFatal;
mIgnoreBOM = aIgnoreBOM;
aEncoding.Name(mEncoding);
if (aIgnoreBOM) {
mDecoder = aEncoding.NewDecoderWithoutBOMHandling();
} else {
mDecoder = aEncoding.NewDecoderWithBOMRemoval();
}
}
TextDecoderStream::~TextDecoderStream() = default;
JSObject* TextDecoderStream::WrapObject(JSContext* aCx,
JS::Handle<JSObject*> aGivenProto) {
return TextDecoderStream_Binding::Wrap(aCx, this, aGivenProto);
}
// TODO: This function should probably be generated by bindings layer. (Bug
// 1784266)
// TODO: This does not allow shared array buffers, just as the non-stream
// TextDecoder/Encoder don't. (Bug 1561594)
static Span<const uint8_t> ExtractSpanFromBufferSource(
JSContext* aCx, JS::Handle<JS::Value> aBufferSource, ErrorResult& aRv) {
if (!aBufferSource.isObject()) {
aRv.ThrowTypeError("Input is not an ArrayBuffer nor an ArrayBufferView");
return Span<const uint8_t>();
}
bool tryNext;
RootedUnion<OwningArrayBufferViewOrArrayBuffer> bufferSource(aCx);
if (bufferSource.TrySetToArrayBufferView(aCx, aBufferSource, tryNext,
false) &&
!tryNext) {
ArrayBufferView& view = bufferSource.GetAsArrayBufferView();
view.ComputeState();
return Span(view.Data(), view.Length());
}
if (!tryNext) {
aRv.MightThrowJSException();
aRv.StealExceptionFromJSContext(aCx);
return Span<const uint8_t>();
}
if (bufferSource.TrySetToArrayBuffer(aCx, aBufferSource, tryNext, false) &&
!tryNext) {
ArrayBuffer& buffer = bufferSource.GetAsArrayBuffer();
buffer.ComputeState();
return Span(buffer.Data(), buffer.Length());
}
if (!tryNext) {
aRv.MightThrowJSException();
aRv.StealExceptionFromJSContext(aCx);
return Span<const uint8_t>();
}
aRv.ThrowTypeError("Input is not an ArrayBuffer nor an ArrayBufferView");
return Span<const uint8_t>();
}
class TextDecoderStreamAlgorithms : public TransformerAlgorithmsWrapper {
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(TextDecoderStreamAlgorithms,
TransformerAlgorithmsBase)
void SetDecoderStream(TextDecoderStream& aStream) {
mDecoderStream = &aStream;
}
// The common part of decode-and-enqueue and flush-and-enqueue.
// Note that the most of the decoding algorithm is implemented in
// mozilla::Decoder, and this is mainly about calling it properly.
// https://encoding.spec.whatwg.org/#decode-and-enqueue-a-chunk
MOZ_CAN_RUN_SCRIPT void DecodeSpanAndEnqueue(
JSContext* aCx, Span<const uint8_t> aInput, bool aFlush,
TransformStreamDefaultController& aController, ErrorResult& aRv) {
CheckedInt<nsAString::size_type> needed =
mDecoderStream->Decoder()->MaxUTF16BufferLength(aInput.Length());
if (!needed.isValid()) {
aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
return;
}
nsString outDecodedString;
auto output = outDecodedString.GetMutableData(needed.value(), fallible);
if (!output) {
aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
return;
}
mDecoderStream->DecodeNative(aInput, !aFlush, outDecodedString, aRv);
if (aRv.Failed()) {
return;
}
if (outDecodedString.Length()) {
// Step 4.2. If outputChunk is non-empty, then enqueue outputChunk in
// decoders transform.
JS::Rooted<JS::Value> outputChunk(aCx);
if (!xpc::NonVoidStringToJsval(aCx, outDecodedString, &outputChunk)) {
JS_ClearPendingException(aCx);
aRv.Throw(NS_ERROR_UNEXPECTED);
return;
}
aController.Enqueue(aCx, outputChunk, aRv);
}
}
// https://encoding.spec.whatwg.org/#dom-textdecoderstream
MOZ_CAN_RUN_SCRIPT void TransformCallbackImpl(
JS::Handle<JS::Value> aChunk,
TransformStreamDefaultController& aController,
ErrorResult& aRv) override {
// Step 7. Let transformAlgorithm be an algorithm which takes a chunk
// argument and runs the decode and enqueue a chunk algorithm with this and
// chunk.
// https://encoding.spec.whatwg.org/#decode-and-enqueue-a-chunk
AutoJSAPI jsapi;
if (!jsapi.Init(aController.GetParentObject())) {
aRv.ThrowUnknownError("Internal error");
return;
}
JSContext* cx = jsapi.cx();
// Step 1. Let bufferSource be the result of converting chunk to an
// [AllowShared] BufferSource.
// (But here we get a mozilla::Span instead)
Span<const uint8_t> input = ExtractSpanFromBufferSource(cx, aChunk, aRv);
if (aRv.Failed()) {
return;
}
DecodeSpanAndEnqueue(cx, input, false, aController, aRv);
}
// https://encoding.spec.whatwg.org/#dom-textdecoderstream
MOZ_CAN_RUN_SCRIPT void FlushCallbackImpl(
TransformStreamDefaultController& aController,
ErrorResult& aRv) override {
// Step 8. Let flushAlgorithm be an algorithm which takes no arguments and
// runs the flush and enqueue algorithm with this.
AutoJSAPI jsapi;
if (!jsapi.Init(aController.GetParentObject())) {
aRv.ThrowUnknownError("Internal error");
return;
}
JSContext* cx = jsapi.cx();
// https://encoding.spec.whatwg.org/#flush-and-enqueue
// (The flush and enqueue algorithm is basically a subset of decode and
// enqueue one, so let's reuse it)
DecodeSpanAndEnqueue(cx, Span<const uint8_t>(), true, aController, aRv);
}
private:
~TextDecoderStreamAlgorithms() override = default;
RefPtr<TextDecoderStream> mDecoderStream;
};
NS_IMPL_CYCLE_COLLECTION_INHERITED(TextDecoderStreamAlgorithms,
TransformerAlgorithmsBase, mDecoderStream)
NS_IMPL_ADDREF_INHERITED(TextDecoderStreamAlgorithms, TransformerAlgorithmsBase)
NS_IMPL_RELEASE_INHERITED(TextDecoderStreamAlgorithms,
TransformerAlgorithmsBase)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(TextDecoderStreamAlgorithms)
NS_INTERFACE_MAP_END_INHERITING(TransformerAlgorithmsBase)
// https://encoding.spec.whatwg.org/#dom-textdecoderstream
already_AddRefed<TextDecoderStream> TextDecoderStream::Constructor(
const GlobalObject& aGlobal, const nsAString& aLabel,
const TextDecoderOptions& aOptions, ErrorResult& aRv) {
// Step 1. Let encoding be the result of getting an encoding from label.
const Encoding* encoding = Encoding::ForLabelNoReplacement(aLabel);
// Step 2. If encoding is failure or replacement, then throw a RangeError
if (!encoding) {
NS_ConvertUTF16toUTF8 label(aLabel);
label.Trim(" \t\n\f\r");
aRv.ThrowRangeError<MSG_ENCODING_NOT_SUPPORTED>(label);
return nullptr;
}
// Step 3-6. (Done in the constructor)
// Step 7-8.
auto algorithms = MakeRefPtr<TextDecoderStreamAlgorithms>();
// Step 9-10.
RefPtr<TransformStream> transformStream =
TransformStream::CreateGeneric(aGlobal, *algorithms, aRv);
if (aRv.Failed()) {
return nullptr;
}
// Step 11. (Done in the constructor)
auto decoderStream = MakeRefPtr<TextDecoderStream>(
aGlobal.GetAsSupports(), *encoding, aOptions.mFatal, aOptions.mIgnoreBOM,
*transformStream);
algorithms->SetDecoderStream(*decoderStream);
return decoderStream.forget();
}
ReadableStream* TextDecoderStream::Readable() const {
return mStream->Readable();
}
WritableStream* TextDecoderStream::Writable() const {
return mStream->Writable();
}
} // namespace mozilla::dom

Просмотреть файл

@ -0,0 +1,74 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* 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 http://mozilla.org/MPL/2.0/. */
#ifndef DOM_ENCODING_TEXTDECODERSTREAM_H_
#define DOM_ENCODING_TEXTDECODERSTREAM_H_
#include "js/TypeDecls.h"
#include "mozilla/Attributes.h"
#include "mozilla/ErrorResult.h"
#include "mozilla/dom/BindingDeclarations.h"
#include "mozilla/dom/TextDecoder.h"
#include "nsCycleCollectionParticipant.h"
#include "nsWrapperCache.h"
class nsIGlobalObject;
namespace mozilla {
class Decoder;
class Encoding;
namespace dom {
class ReadableStream;
class WritableStream;
struct TextDecoderOptions;
class TransformStream;
} // namespace dom
} // namespace mozilla
namespace mozilla::dom {
class TextDecoderStream final : public nsISupports,
public nsWrapperCache,
public TextDecoderCommon {
public:
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(TextDecoderStream)
public:
TextDecoderStream(nsISupports* aGlobal, const Encoding& aEncoding,
bool aFatal, bool aIgnoreBOM, TransformStream& aStream);
nsISupports* GetParentObject() const { return mGlobal; }
JSObject* WrapObject(JSContext* aCx,
JS::Handle<JSObject*> aGivenProto) override;
mozilla::Decoder* Decoder() { return mDecoder.get(); }
// TODO: Mark as MOZ_CAN_RUN_SCRIPT when IDL constructors can be (bug 1749042)
MOZ_CAN_RUN_SCRIPT_BOUNDARY static already_AddRefed<TextDecoderStream>
Constructor(const GlobalObject& aGlobal, const nsAString& aLabel,
const TextDecoderOptions& aOptions, ErrorResult& aRv);
ReadableStream* Readable() const;
WritableStream* Writable() const;
private:
~TextDecoderStream();
nsCOMPtr<nsISupports> mGlobal;
RefPtr<TransformStream> mStream;
};
} // namespace mozilla::dom
#endif // DOM_ENCODING_TEXTDECODERSTREAM_H_

Просмотреть файл

@ -0,0 +1,240 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* 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 http://mozilla.org/MPL/2.0/. */
#include "mozilla/dom/TextEncoderStream.h"
#include "js/ArrayBuffer.h"
#include "js/experimental/TypedData.h"
#include "nsIGlobalObject.h"
#include "mozilla/Encoding.h"
#include "mozilla/dom/BindingUtils.h"
#include "mozilla/dom/TextEncoderStreamBinding.h"
#include "mozilla/dom/TransformerCallbackHelpers.h"
#include "mozilla/dom/TransformStream.h"
namespace mozilla::dom {
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(TextEncoderStream, mGlobal, mStream)
NS_IMPL_CYCLE_COLLECTING_ADDREF(TextEncoderStream)
NS_IMPL_CYCLE_COLLECTING_RELEASE(TextEncoderStream)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(TextEncoderStream)
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
NS_INTERFACE_MAP_ENTRY(nsISupports)
NS_INTERFACE_MAP_END
TextEncoderStream::TextEncoderStream(nsISupports* aGlobal,
TransformStream& aStream)
: mGlobal(aGlobal), mStream(&aStream) {
// See the comment in EncodeNative() about why this uses a decoder instead of
// `UTF_8_ENCODING->NewEncoder()`.
// XXX: We have to consciously choose 16LE/BE because we ultimately have to read
// char16_t* as uint8_t*. See the same comment.
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
mDecoder = UTF_16LE_ENCODING->NewDecoder();
#else
mDecoder = UTF_16BE_ENCODING->NewDecoder();
#endif
}
TextEncoderStream::~TextEncoderStream() = default;
JSObject* TextEncoderStream::WrapObject(JSContext* aCx,
JS::Handle<JSObject*> aGivenProto) {
return TextEncoderStream_Binding::Wrap(aCx, this, aGivenProto);
}
// Note that the most of the encoding algorithm is implemented in
// mozilla::Decoder (see the comment in EncodeNative()), and this is mainly
// about calling it properly.
static void EncodeNative(JSContext* aCx, mozilla::Decoder* aDecoder,
Span<const char16_t> aInput, const bool aFlush,
JS::MutableHandle<JSObject*> aOutputArrayBufferView,
ErrorResult& aRv) {
// XXX: Adjust the length since Decoder always accepts uint8_t (whereas
// Encoder also accepts char16_t, see below).
if (aInput.Length() > SIZE_MAX / 2) {
aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
return;
}
size_t lengthU8 = aInput.Length() * 2;
CheckedInt<nsAString::size_type> needed =
aDecoder->MaxUTF8BufferLength(lengthU8);
if (!needed.isValid()) {
aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
return;
}
UniquePtr<uint8_t> buffer(
static_cast<uint8_t*>(JS_malloc(aCx, needed.value())));
if (!buffer) {
aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
return;
}
mozilla::Span<uint8_t> input((uint8_t*)aInput.data(), lengthU8);
mozilla::Span<uint8_t> output(buffer, needed.value());
// This originally wanted to use mozilla::Encoder::Encode() that accepts
// char16_t*, but it lacks the pending-high-surrogate feature to properly
// implement
// https://encoding.spec.whatwg.org/#convert-code-unit-to-scalar-value.
// See also https://github.com/hsivonen/encoding_rs/issues/82 about the
// reasoning.
// XXX: The code is more verbose here since we need to convert to
// uint8_t* which is the only type mozilla::Decoder accepts.
uint32_t result;
size_t read;
size_t written;
std::tie(result, read, written, std::ignore) =
aDecoder->DecodeToUTF8(input, output, aFlush);
MOZ_ASSERT(result == kInputEmpty);
MOZ_ASSERT(read == lengthU8);
MOZ_ASSERT(written <= needed.value());
// https://encoding.spec.whatwg.org/#encode-and-enqueue-a-chunk
// Step 4.2.2.1. Let chunk be a Uint8Array object wrapping an ArrayBuffer
// containing output.
JS::Rooted<JSObject*> arrayBuffer(
aCx, JS::NewArrayBufferWithContents(aCx, written, buffer.release()));
if (!arrayBuffer.get()) {
JS_ClearPendingException(aCx);
aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
return;
}
aOutputArrayBufferView.set(JS_NewUint8ArrayWithBuffer(
aCx, arrayBuffer, 0, static_cast<int64_t>(written)));
if (!aOutputArrayBufferView.get()) {
aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
return;
}
}
class TextEncoderStreamAlgorithms : public TransformerAlgorithmsWrapper {
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(TextEncoderStreamAlgorithms,
TransformerAlgorithmsBase)
void SetEncoderStream(TextEncoderStream& aStream) {
mEncoderStream = &aStream;
}
// The common part of encode-and-enqueue and encode-and-flush.
// https://encoding.spec.whatwg.org/#decode-and-enqueue-a-chunk
MOZ_CAN_RUN_SCRIPT void EncodeAndEnqueue(
JSContext* aCx, const nsAString& aInput,
TransformStreamDefaultController& aController, bool aFlush,
ErrorResult& aRv) {
JS::Rooted<JSObject*> outView(aCx);
// Passing a Decoder for a reason, see the comments in the method.
EncodeNative(aCx, mEncoderStream->Decoder(), aInput, aFlush, &outView, aRv);
if (JS_GetTypedArrayLength(outView) > 0) {
// Step 4.2.2.2. Enqueue chunk into encoders transform.
JS::Rooted<JS::Value> value(aCx, JS::ObjectValue(*outView));
aController.Enqueue(aCx, value, aRv);
}
}
// https://encoding.spec.whatwg.org/#dom-textencoderstream
MOZ_CAN_RUN_SCRIPT void TransformCallbackImpl(
JS::Handle<JS::Value> aChunk,
TransformStreamDefaultController& aController,
ErrorResult& aRv) override {
// Step 2. Let transformAlgorithm be an algorithm which takes a chunk
// argument and runs the encode and enqueue a chunk algorithm with this and
// chunk.
AutoJSAPI jsapi;
if (!jsapi.Init(aController.GetParentObject())) {
aRv.ThrowUnknownError("Internal error");
return;
}
JSContext* cx = jsapi.cx();
// https://encoding.spec.whatwg.org/#encode-and-enqueue-a-chunk
// Step 1. Let input be the result of converting chunk to a DOMString.
// Step 2. Convert input to an I/O queue of code units.
nsString str;
if (!ConvertJSValueToString(cx, aChunk, eStringify, eStringify, str)) {
aRv.MightThrowJSException();
aRv.StealExceptionFromJSContext(cx);
return;
}
EncodeAndEnqueue(cx, str, aController, false, aRv);
}
// https://encoding.spec.whatwg.org/#dom-textencoderstream
MOZ_CAN_RUN_SCRIPT void FlushCallbackImpl(
TransformStreamDefaultController& aController,
ErrorResult& aRv) override {
// Step 3. Let flushAlgorithm be an algorithm which runs the encode and
// flush algorithm with this.
AutoJSAPI jsapi;
if (!jsapi.Init(aController.GetParentObject())) {
aRv.ThrowUnknownError("Internal error");
return;
}
JSContext* cx = jsapi.cx();
// The spec manually manages pending high surrogate here, but let's call the
// encoder as it's managed there.
EncodeAndEnqueue(cx, u""_ns, aController, true, aRv);
}
private:
~TextEncoderStreamAlgorithms() override = default;
RefPtr<TextEncoderStream> mEncoderStream;
};
NS_IMPL_CYCLE_COLLECTION_INHERITED(TextEncoderStreamAlgorithms,
TransformerAlgorithmsBase, mEncoderStream)
NS_IMPL_ADDREF_INHERITED(TextEncoderStreamAlgorithms, TransformerAlgorithmsBase)
NS_IMPL_RELEASE_INHERITED(TextEncoderStreamAlgorithms,
TransformerAlgorithmsBase)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(TextEncoderStreamAlgorithms)
NS_INTERFACE_MAP_END_INHERITING(TransformerAlgorithmsBase)
// https://encoding.spec.whatwg.org/#dom-textencoderstream
already_AddRefed<TextEncoderStream> TextEncoderStream::Constructor(
const GlobalObject& aGlobal, ErrorResult& aRv) {
// Step 1. Set thiss encoder to an instance of the UTF-8 encoder.
// Step 2-3
auto algorithms = MakeRefPtr<TextEncoderStreamAlgorithms>();
// Step 4-5
RefPtr<TransformStream> transformStream =
TransformStream::CreateGeneric(aGlobal, *algorithms, aRv);
if (aRv.Failed()) {
return nullptr;
}
// Step 6. Set thiss transform to transformStream.
// (Done in the constructor)
auto encoderStream =
MakeRefPtr<TextEncoderStream>(aGlobal.GetAsSupports(), *transformStream);
algorithms->SetEncoderStream(*encoderStream);
return encoderStream.forget();
}
ReadableStream* TextEncoderStream::Readable() const {
return mStream->Readable();
}
WritableStream* TextEncoderStream::Writable() const {
return mStream->Writable();
}
void TextEncoderStream::GetEncoding(nsCString& aRetVal) const {
aRetVal.AssignLiteral("utf-8");
}
} // namespace mozilla::dom

Просмотреть файл

@ -0,0 +1,70 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* 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 http://mozilla.org/MPL/2.0/. */
#ifndef DOM_ENCODING_TEXTENCODERSTREAM_H_
#define DOM_ENCODING_TEXTENCODERSTREAM_H_
#include "js/TypeDecls.h"
#include "mozilla/Attributes.h"
#include "mozilla/ErrorResult.h"
#include "mozilla/dom/BindingDeclarations.h"
#include "nsCycleCollectionParticipant.h"
#include "nsWrapperCache.h"
class nsIGlobalObject;
namespace mozilla {
class Decoder;
namespace dom {
class ReadableStream;
class WritableStream;
class TransformStream;
} // namespace dom
} // namespace mozilla
namespace mozilla::dom {
class TextEncoderStream final : public nsISupports, public nsWrapperCache {
public:
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(TextEncoderStream)
public:
TextEncoderStream(nsISupports* aGlobal, TransformStream& aStream);
nsISupports* GetParentObject() const { return mGlobal; }
JSObject* WrapObject(JSContext* aCx,
JS::Handle<JSObject*> aGivenProto) override;
mozilla::Decoder* Decoder() { return mDecoder.get(); }
// TODO: Mark as MOZ_CAN_RUN_SCRIPT when IDL constructors can be (bug 1749042)
MOZ_CAN_RUN_SCRIPT_BOUNDARY static already_AddRefed<TextEncoderStream>
Constructor(const GlobalObject& aGlobal, ErrorResult& aRv);
ReadableStream* Readable() const;
WritableStream* Writable() const;
void GetEncoding(nsCString& aRetVal) const;
private:
~TextEncoderStream();
nsCOMPtr<nsISupports> mGlobal;
RefPtr<TransformStream> mStream;
mozilla::UniquePtr<mozilla::Decoder> mDecoder;
};
} // namespace mozilla::dom
#endif // DOM_ENCODING_TEXTENCODERSTREAM_H_

Просмотреть файл

@ -9,12 +9,16 @@ with Files("**"):
EXPORTS.mozilla.dom += [
"TextDecoder.h",
"TextDecoderStream.h",
"TextEncoder.h",
"TextEncoderStream.h",
]
UNIFIED_SOURCES += [
"TextDecoder.cpp",
"TextDecoderStream.cpp",
"TextEncoder.cpp",
"TextEncoderStream.cpp",
]
FINAL_LIBRARY = "xul"

Просмотреть файл

@ -327,8 +327,12 @@ let interfaceNamesInGlobalScope = [
// IMPORTANT: Do not change this list without review from a DOM peer!
"TextDecoder",
// IMPORTANT: Do not change this list without review from a DOM peer!
"TextDecoderStream",
// IMPORTANT: Do not change this list without review from a DOM peer!
"TextEncoder",
// IMPORTANT: Do not change this list without review from a DOM peer!
"TextEncoderStream",
// IMPORTANT: Do not change this list without review from a DOM peer!
"TextMetrics",
// IMPORTANT: Do not change this list without review from a DOM peer!
"TransformStream",

Просмотреть файл

@ -1266,8 +1266,12 @@ let interfaceNamesInGlobalScope = [
// IMPORTANT: Do not change this list without review from a DOM peer!
{ name: "TextDecoder", insecureContext: true },
// IMPORTANT: Do not change this list without review from a DOM peer!
{ name: "TextDecoderStream", insecureContext: true },
// IMPORTANT: Do not change this list without review from a DOM peer!
{ name: "TextEncoder", insecureContext: true },
// IMPORTANT: Do not change this list without review from a DOM peer!
{ name: "TextEncoderStream", insecureContext: true },
// IMPORTANT: Do not change this list without review from a DOM peer!
{ name: "TextMetrics", insecureContext: true },
// IMPORTANT: Do not change this list without review from a DOM peer!
{ name: "TextTrack", insecureContext: true },

Просмотреть файл

@ -0,0 +1,13 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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 http://mozilla.org/MPL/2.0/.
*
* The origin of this IDL file is
* https://streams.spec.whatwg.org/#other-specs-ts-wrapping
*/
interface mixin GenericTransformStream {
readonly attribute ReadableStream readable;
readonly attribute WritableStream writable;
};

Просмотреть файл

@ -5,26 +5,27 @@
*
* The origin of this IDL file is
* http://encoding.spec.whatwg.org/#interface-textdecoder
*
* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/
*/
interface mixin TextDecoderCommon {
[Constant]
readonly attribute DOMString encoding;
[Constant]
readonly attribute boolean fatal;
[Constant]
readonly attribute boolean ignoreBOM;
};
[Exposed=(Window,Worker)]
interface TextDecoder {
[Throws]
constructor(optional DOMString label = "utf-8",
optional TextDecoderOptions options = {});
[Constant]
readonly attribute DOMString encoding;
[Constant]
readonly attribute boolean fatal;
[Constant]
readonly attribute boolean ignoreBOM;
[Throws]
USVString decode(optional BufferSource input, optional TextDecodeOptions options = {});
};
TextDecoder includes TextDecoderCommon;
dictionary TextDecoderOptions {
boolean fatal = false;
@ -34,4 +35,3 @@ dictionary TextDecoderOptions {
dictionary TextDecodeOptions {
boolean stream = false;
};

Просмотреть файл

@ -0,0 +1,16 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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 http://mozilla.org/MPL/2.0/.
*
* The origin of this IDL file is
* http://encoding.spec.whatwg.org/#interface-textdecoderstream
*/
[Exposed=*]
interface TextDecoderStream {
[Throws]
constructor(optional DOMString label = "utf-8", optional TextDecoderOptions options = {});
};
TextDecoderStream includes TextDecoderCommon;
TextDecoderStream includes GenericTransformStream;

Просмотреть файл

@ -5,11 +5,19 @@
*
* The origin of this IDL file is
* http://encoding.spec.whatwg.org/#interface-textencoder
*
* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/
*/
interface mixin TextEncoderCommon {
/*
* This is DOMString in the spec, but the value is always ASCII
* and short. By declaring this as ByteString, we get the same
* end result (storage as inline Latin1 string in SpiderMonkey)
* with fewer conversions.
*/
[Constant]
readonly attribute ByteString encoding;
};
dictionary TextEncoderEncodeIntoResult {
unsigned long long read;
unsigned long long written;
@ -19,15 +27,6 @@ dictionary TextEncoderEncodeIntoResult {
interface TextEncoder {
constructor();
/*
* This is DOMString in the spec, but the value is always ASCII
* and short. By declaring this as ByteString, we get the same
* end result (storage as inline Latin1 string in SpiderMonkey)
* with fewer conversions.
*/
[Constant]
readonly attribute ByteString encoding;
/*
* This is spec-wise USVString but marking it as UTF8String as an
* optimization. (The SpiderMonkey-provided conversion to UTF-8 takes care of
@ -46,3 +45,4 @@ interface TextEncoder {
[CanOOM]
TextEncoderEncodeIntoResult encodeInto(JSString source, Uint8Array destination);
};
TextEncoder includes TextEncoderCommon;

Просмотреть файл

@ -0,0 +1,16 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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 http://mozilla.org/MPL/2.0/.
*
* The origin of this IDL file is
* http://encoding.spec.whatwg.org/#interface-textdecoderstream
*/
[Exposed=*]
interface TextEncoderStream {
[Throws]
constructor();
};
TextEncoderStream includes TextEncoderCommon;
TextEncoderStream includes GenericTransformStream;

Просмотреть файл

@ -571,6 +571,7 @@ WEBIDL_FILES = [
"GamepadPose.webidl",
"GamepadServiceTest.webidl",
"GamepadTouch.webidl",
"GenericTransformStream.webidl",
"Geolocation.webidl",
"GeolocationCoordinates.webidl",
"GeolocationPosition.webidl",
@ -946,7 +947,9 @@ WEBIDL_FILES = [
"Text.webidl",
"TextClause.webidl",
"TextDecoder.webidl",
"TextDecoderStream.webidl",
"TextEncoder.webidl",
"TextEncoderStream.webidl",
"TextTrack.webidl",
"TextTrackCue.webidl",
"TextTrackCueList.webidl",

Просмотреть файл

@ -309,8 +309,12 @@ let interfaceNamesInGlobalScope = [
// IMPORTANT: Do not change this list without review from a DOM peer!
{ name: "TextDecoder", insecureContext: true },
// IMPORTANT: Do not change this list without review from a DOM peer!
{ name: "TextDecoderStream", insecureContext: true },
// IMPORTANT: Do not change this list without review from a DOM peer!
{ name: "TextEncoder", insecureContext: true },
// IMPORTANT: Do not change this list without review from a DOM peer!
{ name: "TextEncoderStream", insecureContext: true },
// IMPORTANT: Do not change this list without review from a DOM peer!
{ name: "TextMetrics", insecureContext: true },
// IMPORTANT: Do not change this list without review from a DOM peer!
{ name: "TransformStream", insecureContext: true },

Просмотреть файл

@ -1,202 +0,0 @@
[idlharness.https.any.serviceworker.html]
expected: TIMEOUT
[idlharness.any.worker.html]
[TextEncoderStream interface object length]
expected: FAIL
[TextDecoderStream interface object length]
expected: FAIL
[TextEncoderStream interface: existence and properties of interface prototype object's "constructor" property]
expected: FAIL
[TextEncoderStream interface: existence and properties of interface object]
expected: FAIL
[TextDecoderStream interface: existence and properties of interface prototype object's @@unscopables property]
expected: FAIL
[TextEncoderStream interface object name]
expected: FAIL
[TextDecoderStream interface: attribute fatal]
expected: FAIL
[TextEncoderStream interface: existence and properties of interface prototype object's @@unscopables property]
expected: FAIL
[TextDecoderStream interface: existence and properties of interface prototype object's "constructor" property]
expected: FAIL
[TextDecoderStream interface: attribute ignoreBOM]
expected: FAIL
[TextDecoderStream interface: existence and properties of interface object]
expected: FAIL
[TextDecoderStream interface: attribute encoding]
expected: FAIL
[TextEncoderStream interface: attribute encoding]
expected: FAIL
[TextDecoderStream interface: existence and properties of interface prototype object]
expected: FAIL
[TextDecoderStream interface object name]
expected: FAIL
[TextEncoderStream interface: existence and properties of interface prototype object]
expected: FAIL
[idlharness.any.sharedworker.html]
[TextEncoderStream interface object length]
expected: FAIL
[TextDecoderStream interface object length]
expected: FAIL
[TextEncoderStream interface: existence and properties of interface prototype object's "constructor" property]
expected: FAIL
[TextEncoderStream interface: existence and properties of interface object]
expected: FAIL
[TextDecoderStream interface: existence and properties of interface prototype object's @@unscopables property]
expected: FAIL
[TextEncoderStream interface object name]
expected: FAIL
[TextDecoderStream interface: attribute fatal]
expected: FAIL
[TextEncoderStream interface: existence and properties of interface prototype object's @@unscopables property]
expected: FAIL
[TextDecoderStream interface: existence and properties of interface prototype object's "constructor" property]
expected: FAIL
[TextDecoderStream interface: attribute ignoreBOM]
expected: FAIL
[TextDecoderStream interface: existence and properties of interface object]
expected: FAIL
[TextDecoderStream interface: attribute encoding]
expected: FAIL
[TextEncoderStream interface: attribute encoding]
expected: FAIL
[TextDecoderStream interface: existence and properties of interface prototype object]
expected: FAIL
[TextDecoderStream interface object name]
expected: FAIL
[TextEncoderStream interface: existence and properties of interface prototype object]
expected: FAIL
[idlharness.any.html]
[TextEncoderStream interface object length]
expected: FAIL
[TextDecoderStream interface object length]
expected: FAIL
[TextEncoderStream interface: existence and properties of interface prototype object's "constructor" property]
expected: FAIL
[TextEncoderStream interface: existence and properties of interface object]
expected: FAIL
[TextDecoderStream interface: existence and properties of interface prototype object's @@unscopables property]
expected: FAIL
[TextEncoderStream interface object name]
expected: FAIL
[TextDecoderStream interface: attribute fatal]
expected: FAIL
[TextEncoderStream interface: existence and properties of interface prototype object's @@unscopables property]
expected: FAIL
[TextDecoderStream interface: existence and properties of interface prototype object's "constructor" property]
expected: FAIL
[TextDecoderStream interface: attribute ignoreBOM]
expected: FAIL
[TextDecoderStream interface: existence and properties of interface object]
expected: FAIL
[TextDecoderStream interface: attribute encoding]
expected: FAIL
[TextEncoderStream interface: attribute encoding]
expected: FAIL
[TextDecoderStream interface: existence and properties of interface prototype object]
expected: FAIL
[TextDecoderStream interface object name]
expected: FAIL
[TextEncoderStream interface: existence and properties of interface prototype object]
expected: FAIL
[idlharness.any.serviceworker.html]
[TextEncoderStream interface object length]
expected: FAIL
[TextDecoderStream interface object length]
expected: FAIL
[TextEncoderStream interface: existence and properties of interface prototype object's "constructor" property]
expected: FAIL
[TextEncoderStream interface: existence and properties of interface object]
expected: FAIL
[TextDecoderStream interface: existence and properties of interface prototype object's @@unscopables property]
expected: FAIL
[TextEncoderStream interface object name]
expected: FAIL
[TextDecoderStream interface: attribute fatal]
expected: FAIL
[TextEncoderStream interface: existence and properties of interface prototype object's @@unscopables property]
expected: FAIL
[TextDecoderStream interface: existence and properties of interface prototype object's "constructor" property]
expected: FAIL
[TextDecoderStream interface: attribute ignoreBOM]
expected: FAIL
[TextDecoderStream interface: existence and properties of interface object]
expected: FAIL
[TextDecoderStream interface: attribute encoding]
expected: FAIL
[TextEncoderStream interface: attribute encoding]
expected: FAIL
[TextDecoderStream interface: existence and properties of interface prototype object]
expected: FAIL
[TextDecoderStream interface object name]
expected: FAIL
[TextEncoderStream interface: existence and properties of interface prototype object]
expected: FAIL

Просмотреть файл

@ -1,58 +0,0 @@
[backpressure.any.html]
[write() should not complete until read relieves backpressure for TextEncoderStream]
expected: FAIL
[additional writes should wait for backpressure to be relieved for class TextDecoderStream]
expected: FAIL
[write() should not complete until read relieves backpressure for TextDecoderStream]
expected: FAIL
[additional writes should wait for backpressure to be relieved for class TextEncoderStream]
expected: FAIL
[backpressure.https.any.serviceworker.html]
expected: TIMEOUT
[backpressure.any.worker.html]
[write() should not complete until read relieves backpressure for TextEncoderStream]
expected: FAIL
[additional writes should wait for backpressure to be relieved for class TextDecoderStream]
expected: FAIL
[write() should not complete until read relieves backpressure for TextDecoderStream]
expected: FAIL
[additional writes should wait for backpressure to be relieved for class TextEncoderStream]
expected: FAIL
[backpressure.any.sharedworker.html]
[write() should not complete until read relieves backpressure for TextEncoderStream]
expected: FAIL
[additional writes should wait for backpressure to be relieved for class TextDecoderStream]
expected: FAIL
[write() should not complete until read relieves backpressure for TextDecoderStream]
expected: FAIL
[additional writes should wait for backpressure to be relieved for class TextEncoderStream]
expected: FAIL
[backpressure.any.serviceworker.html]
[write() should not complete until read relieves backpressure for TextEncoderStream]
expected: FAIL
[additional writes should wait for backpressure to be relieved for class TextDecoderStream]
expected: FAIL
[write() should not complete until read relieves backpressure for TextDecoderStream]
expected: FAIL
[additional writes should wait for backpressure to be relieved for class TextEncoderStream]
expected: FAIL

Просмотреть файл

@ -1,343 +0,0 @@
[decode-attributes.any.serviceworker.html]
[a throwing fatal member should cause the constructor to throw]
expected: FAIL
[setting ignoreBOM to 'null' should set the attribute to false]
expected: FAIL
[encoding attribute should have correct value for 'iso-8859-2']
expected: FAIL
[setting fatal to 'undefined' should set the attribute to false]
expected: FAIL
[encoding attribute should have correct value for 'unicode-1-1-utf-8']
expected: FAIL
[setting ignoreBOM to '[object Object\]' should set the attribute to true]
expected: FAIL
[setting ignoreBOM to '1' should set the attribute to true]
expected: FAIL
[a throwing ignoreBOM member should cause the constructor to throw]
expected: FAIL
[setting fatal to '0' should set the attribute to false]
expected: FAIL
[constructing with a non-stringifiable encoding should throw]
expected: FAIL
[setting ignoreBOM to '' should set the attribute to true]
expected: FAIL
[constructing with an invalid encoding should throw]
expected: FAIL
[setting fatal to '' should set the attribute to false]
expected: FAIL
[setting fatal to 'false' should set the attribute to false]
expected: FAIL
[setting ignoreBOM to 'false' should set the attribute to false]
expected: FAIL
[setting ignoreBOM to '' should set the attribute to false]
expected: FAIL
[setting fatal to '1' should set the attribute to true]
expected: FAIL
[setting fatal to '[object Object\]' should set the attribute to true]
expected: FAIL
[setting fatal to 'true' should set the attribute to true]
expected: FAIL
[setting ignoreBOM to 'undefined' should set the attribute to false]
expected: FAIL
[setting fatal to 'null' should set the attribute to false]
expected: FAIL
[setting ignoreBOM to 'yes' should set the attribute to true]
expected: FAIL
[setting fatal to 'yes' should set the attribute to true]
expected: FAIL
[encoding attribute should have correct value for 'utf-16']
expected: FAIL
[setting ignoreBOM to '0' should set the attribute to false]
expected: FAIL
[setting ignoreBOM to 'true' should set the attribute to true]
expected: FAIL
[setting fatal to '' should set the attribute to true]
expected: FAIL
[encoding attribute should have correct value for 'ascii']
expected: FAIL
[decode-attributes.any.sharedworker.html]
[a throwing fatal member should cause the constructor to throw]
expected: FAIL
[setting ignoreBOM to 'null' should set the attribute to false]
expected: FAIL
[encoding attribute should have correct value for 'iso-8859-2']
expected: FAIL
[setting fatal to 'undefined' should set the attribute to false]
expected: FAIL
[encoding attribute should have correct value for 'unicode-1-1-utf-8']
expected: FAIL
[setting ignoreBOM to '[object Object\]' should set the attribute to true]
expected: FAIL
[setting ignoreBOM to '1' should set the attribute to true]
expected: FAIL
[a throwing ignoreBOM member should cause the constructor to throw]
expected: FAIL
[setting fatal to '0' should set the attribute to false]
expected: FAIL
[constructing with a non-stringifiable encoding should throw]
expected: FAIL
[setting ignoreBOM to '' should set the attribute to true]
expected: FAIL
[constructing with an invalid encoding should throw]
expected: FAIL
[setting fatal to '' should set the attribute to false]
expected: FAIL
[setting fatal to 'false' should set the attribute to false]
expected: FAIL
[setting ignoreBOM to 'false' should set the attribute to false]
expected: FAIL
[setting ignoreBOM to '' should set the attribute to false]
expected: FAIL
[setting fatal to '1' should set the attribute to true]
expected: FAIL
[setting fatal to '[object Object\]' should set the attribute to true]
expected: FAIL
[setting fatal to 'true' should set the attribute to true]
expected: FAIL
[setting ignoreBOM to 'undefined' should set the attribute to false]
expected: FAIL
[setting fatal to 'null' should set the attribute to false]
expected: FAIL
[setting ignoreBOM to 'yes' should set the attribute to true]
expected: FAIL
[setting fatal to 'yes' should set the attribute to true]
expected: FAIL
[encoding attribute should have correct value for 'utf-16']
expected: FAIL
[setting ignoreBOM to '0' should set the attribute to false]
expected: FAIL
[setting ignoreBOM to 'true' should set the attribute to true]
expected: FAIL
[setting fatal to '' should set the attribute to true]
expected: FAIL
[encoding attribute should have correct value for 'ascii']
expected: FAIL
[decode-attributes.any.html]
[a throwing fatal member should cause the constructor to throw]
expected: FAIL
[setting ignoreBOM to 'null' should set the attribute to false]
expected: FAIL
[encoding attribute should have correct value for 'iso-8859-2']
expected: FAIL
[setting fatal to 'undefined' should set the attribute to false]
expected: FAIL
[encoding attribute should have correct value for 'unicode-1-1-utf-8']
expected: FAIL
[setting ignoreBOM to '[object Object\]' should set the attribute to true]
expected: FAIL
[setting ignoreBOM to '1' should set the attribute to true]
expected: FAIL
[a throwing ignoreBOM member should cause the constructor to throw]
expected: FAIL
[setting fatal to '0' should set the attribute to false]
expected: FAIL
[constructing with a non-stringifiable encoding should throw]
expected: FAIL
[setting ignoreBOM to '' should set the attribute to true]
expected: FAIL
[constructing with an invalid encoding should throw]
expected: FAIL
[setting fatal to '' should set the attribute to false]
expected: FAIL
[setting fatal to 'false' should set the attribute to false]
expected: FAIL
[setting ignoreBOM to 'false' should set the attribute to false]
expected: FAIL
[setting ignoreBOM to '' should set the attribute to false]
expected: FAIL
[setting fatal to '1' should set the attribute to true]
expected: FAIL
[setting fatal to '[object Object\]' should set the attribute to true]
expected: FAIL
[setting fatal to 'true' should set the attribute to true]
expected: FAIL
[setting ignoreBOM to 'undefined' should set the attribute to false]
expected: FAIL
[setting fatal to 'null' should set the attribute to false]
expected: FAIL
[setting ignoreBOM to 'yes' should set the attribute to true]
expected: FAIL
[setting fatal to 'yes' should set the attribute to true]
expected: FAIL
[encoding attribute should have correct value for 'utf-16']
expected: FAIL
[setting ignoreBOM to '0' should set the attribute to false]
expected: FAIL
[setting ignoreBOM to 'true' should set the attribute to true]
expected: FAIL
[setting fatal to '' should set the attribute to true]
expected: FAIL
[encoding attribute should have correct value for 'ascii']
expected: FAIL
[decode-attributes.any.worker.html]
[a throwing fatal member should cause the constructor to throw]
expected: FAIL
[setting ignoreBOM to 'null' should set the attribute to false]
expected: FAIL
[encoding attribute should have correct value for 'iso-8859-2']
expected: FAIL
[setting fatal to 'undefined' should set the attribute to false]
expected: FAIL
[encoding attribute should have correct value for 'unicode-1-1-utf-8']
expected: FAIL
[setting ignoreBOM to '[object Object\]' should set the attribute to true]
expected: FAIL
[setting ignoreBOM to '1' should set the attribute to true]
expected: FAIL
[a throwing ignoreBOM member should cause the constructor to throw]
expected: FAIL
[setting fatal to '0' should set the attribute to false]
expected: FAIL
[constructing with a non-stringifiable encoding should throw]
expected: FAIL
[setting ignoreBOM to '' should set the attribute to true]
expected: FAIL
[constructing with an invalid encoding should throw]
expected: FAIL
[setting fatal to '' should set the attribute to false]
expected: FAIL
[setting fatal to 'false' should set the attribute to false]
expected: FAIL
[setting ignoreBOM to 'false' should set the attribute to false]
expected: FAIL
[setting ignoreBOM to '' should set the attribute to false]
expected: FAIL
[setting fatal to '1' should set the attribute to true]
expected: FAIL
[setting fatal to '[object Object\]' should set the attribute to true]
expected: FAIL
[setting fatal to 'true' should set the attribute to true]
expected: FAIL
[setting ignoreBOM to 'undefined' should set the attribute to false]
expected: FAIL
[setting fatal to 'null' should set the attribute to false]
expected: FAIL
[setting ignoreBOM to 'yes' should set the attribute to true]
expected: FAIL
[setting fatal to 'yes' should set the attribute to true]
expected: FAIL
[encoding attribute should have correct value for 'utf-16']
expected: FAIL
[setting ignoreBOM to '0' should set the attribute to false]
expected: FAIL
[setting ignoreBOM to 'true' should set the attribute to true]
expected: FAIL
[setting fatal to '' should set the attribute to true]
expected: FAIL
[encoding attribute should have correct value for 'ascii']
expected: FAIL

Просмотреть файл

@ -1,70 +0,0 @@
[decode-bad-chunks.any.sharedworker.html]
[chunk of type undefined should error the stream]
expected: FAIL
[chunk of type array should error the stream]
expected: FAIL
[chunk of type null should error the stream]
expected: FAIL
[chunk of type object, not BufferSource should error the stream]
expected: FAIL
[chunk of type numeric should error the stream]
expected: FAIL
[decode-bad-chunks.https.any.serviceworker.html]
expected: TIMEOUT
[decode-bad-chunks.any.worker.html]
[chunk of type undefined should error the stream]
expected: FAIL
[chunk of type array should error the stream]
expected: FAIL
[chunk of type null should error the stream]
expected: FAIL
[chunk of type object, not BufferSource should error the stream]
expected: FAIL
[chunk of type numeric should error the stream]
expected: FAIL
[decode-bad-chunks.any.html]
[chunk of type undefined should error the stream]
expected: FAIL
[chunk of type array should error the stream]
expected: FAIL
[chunk of type null should error the stream]
expected: FAIL
[chunk of type object, not BufferSource should error the stream]
expected: FAIL
[chunk of type numeric should error the stream]
expected: FAIL
[decode-bad-chunks.any.serviceworker.html]
[chunk of type undefined should error the stream]
expected: FAIL
[chunk of type array should error the stream]
expected: FAIL
[chunk of type null should error the stream]
expected: FAIL
[chunk of type object, not BufferSource should error the stream]
expected: FAIL
[chunk of type numeric should error the stream]
expected: FAIL

Просмотреть файл

@ -1,154 +0,0 @@
[decode-ignore-bom.any.worker.html]
[ignoreBOM should work for encoding utf-16be, split at character 1]
expected: FAIL
[ignoreBOM should work for encoding utf-16be, split at character 0]
expected: FAIL
[ignoreBOM should work for encoding utf-16be, split at character 3]
expected: FAIL
[ignoreBOM should work for encoding utf-16be, split at character 2]
expected: FAIL
[ignoreBOM should work for encoding utf-8, split at character 0]
expected: FAIL
[ignoreBOM should work for encoding utf-8, split at character 1]
expected: FAIL
[ignoreBOM should work for encoding utf-8, split at character 2]
expected: FAIL
[ignoreBOM should work for encoding utf-8, split at character 3]
expected: FAIL
[ignoreBOM should work for encoding utf-16le, split at character 3]
expected: FAIL
[ignoreBOM should work for encoding utf-16le, split at character 2]
expected: FAIL
[ignoreBOM should work for encoding utf-16le, split at character 1]
expected: FAIL
[ignoreBOM should work for encoding utf-16le, split at character 0]
expected: FAIL
[decode-ignore-bom.any.sharedworker.html]
[ignoreBOM should work for encoding utf-16be, split at character 1]
expected: FAIL
[ignoreBOM should work for encoding utf-16be, split at character 0]
expected: FAIL
[ignoreBOM should work for encoding utf-16be, split at character 3]
expected: FAIL
[ignoreBOM should work for encoding utf-16be, split at character 2]
expected: FAIL
[ignoreBOM should work for encoding utf-8, split at character 0]
expected: FAIL
[ignoreBOM should work for encoding utf-8, split at character 1]
expected: FAIL
[ignoreBOM should work for encoding utf-8, split at character 2]
expected: FAIL
[ignoreBOM should work for encoding utf-8, split at character 3]
expected: FAIL
[ignoreBOM should work for encoding utf-16le, split at character 3]
expected: FAIL
[ignoreBOM should work for encoding utf-16le, split at character 2]
expected: FAIL
[ignoreBOM should work for encoding utf-16le, split at character 1]
expected: FAIL
[ignoreBOM should work for encoding utf-16le, split at character 0]
expected: FAIL
[decode-ignore-bom.https.any.serviceworker.html]
expected: TIMEOUT
[decode-ignore-bom.any.html]
[ignoreBOM should work for encoding utf-16be, split at character 1]
expected: FAIL
[ignoreBOM should work for encoding utf-16be, split at character 0]
expected: FAIL
[ignoreBOM should work for encoding utf-16be, split at character 3]
expected: FAIL
[ignoreBOM should work for encoding utf-16be, split at character 2]
expected: FAIL
[ignoreBOM should work for encoding utf-8, split at character 0]
expected: FAIL
[ignoreBOM should work for encoding utf-8, split at character 1]
expected: FAIL
[ignoreBOM should work for encoding utf-8, split at character 2]
expected: FAIL
[ignoreBOM should work for encoding utf-8, split at character 3]
expected: FAIL
[ignoreBOM should work for encoding utf-16le, split at character 3]
expected: FAIL
[ignoreBOM should work for encoding utf-16le, split at character 2]
expected: FAIL
[ignoreBOM should work for encoding utf-16le, split at character 1]
expected: FAIL
[ignoreBOM should work for encoding utf-16le, split at character 0]
expected: FAIL
[decode-ignore-bom.any.serviceworker.html]
[ignoreBOM should work for encoding utf-16be, split at character 1]
expected: FAIL
[ignoreBOM should work for encoding utf-16be, split at character 0]
expected: FAIL
[ignoreBOM should work for encoding utf-16be, split at character 3]
expected: FAIL
[ignoreBOM should work for encoding utf-16be, split at character 2]
expected: FAIL
[ignoreBOM should work for encoding utf-8, split at character 0]
expected: FAIL
[ignoreBOM should work for encoding utf-8, split at character 1]
expected: FAIL
[ignoreBOM should work for encoding utf-8, split at character 2]
expected: FAIL
[ignoreBOM should work for encoding utf-8, split at character 3]
expected: FAIL
[ignoreBOM should work for encoding utf-16le, split at character 3]
expected: FAIL
[ignoreBOM should work for encoding utf-16le, split at character 2]
expected: FAIL
[ignoreBOM should work for encoding utf-16le, split at character 1]
expected: FAIL
[ignoreBOM should work for encoding utf-16le, split at character 0]
expected: FAIL

Просмотреть файл

@ -1,34 +0,0 @@
[decode-incomplete-input.any.html]
[incomplete input with error mode "fatal" should error the stream]
expected: FAIL
[incomplete input with error mode "replacement" should end with a replacement character]
expected: FAIL
[decode-incomplete-input.any.worker.html]
[incomplete input with error mode "fatal" should error the stream]
expected: FAIL
[incomplete input with error mode "replacement" should end with a replacement character]
expected: FAIL
[decode-incomplete-input.any.sharedworker.html]
[incomplete input with error mode "fatal" should error the stream]
expected: FAIL
[incomplete input with error mode "replacement" should end with a replacement character]
expected: FAIL
[decode-incomplete-input.https.any.serviceworker.html]
expected: TIMEOUT
[decode-incomplete-input.any.serviceworker.html]
[incomplete input with error mode "fatal" should error the stream]
expected: FAIL
[incomplete input with error mode "replacement" should end with a replacement character]
expected: FAIL

Просмотреть файл

@ -1,166 +0,0 @@
[decode-non-utf8.any.sharedworker.html]
[TextDecoderStream should be able to reject invalid sequences in Shift_JIS]
expected: FAIL
[TextDecoderStream should be able to decode invalid sequences in Shift_JIS]
expected: FAIL
[TextDecoderStream should be able to reject invalid sequences in UTF-16LE]
expected: FAIL
[TextDecoderStream should be able to reject invalid sequences in UTF-16BE]
expected: FAIL
[TextDecoderStream should be able to decode Shift_JIS]
expected: FAIL
[TextDecoderStream should be able to decode invalid sequences in UTF-16LE]
expected: FAIL
[TextDecoderStream should be able to decode UTF-16BE]
expected: FAIL
[TextDecoderStream should be able to decode invalid sequences in UTF-16BE]
expected: FAIL
[TextDecoderStream should be able to decode UTF-16LE]
expected: FAIL
[TextDecoderStream should be able to decode ISO-8859-14]
expected: FAIL
[TextDecoderStream should be able to decode invalid sequences in ISO-2022-JP]
expected: FAIL
[TextDecoderStream should be able to decode ISO-2022-JP]
expected: FAIL
[TextDecoderStream should be able to reject invalid sequences in ISO-2022-JP]
expected: FAIL
[decode-non-utf8.https.any.serviceworker.html]
expected: TIMEOUT
[decode-non-utf8.any.html]
[TextDecoderStream should be able to reject invalid sequences in Shift_JIS]
expected: FAIL
[TextDecoderStream should be able to decode invalid sequences in Shift_JIS]
expected: FAIL
[TextDecoderStream should be able to reject invalid sequences in UTF-16LE]
expected: FAIL
[TextDecoderStream should be able to reject invalid sequences in UTF-16BE]
expected: FAIL
[TextDecoderStream should be able to decode Shift_JIS]
expected: FAIL
[TextDecoderStream should be able to decode invalid sequences in UTF-16LE]
expected: FAIL
[TextDecoderStream should be able to decode UTF-16BE]
expected: FAIL
[TextDecoderStream should be able to decode invalid sequences in UTF-16BE]
expected: FAIL
[TextDecoderStream should be able to decode UTF-16LE]
expected: FAIL
[TextDecoderStream should be able to decode ISO-8859-14]
expected: FAIL
[TextDecoderStream should be able to decode invalid sequences in ISO-2022-JP]
expected: FAIL
[TextDecoderStream should be able to decode ISO-2022-JP]
expected: FAIL
[TextDecoderStream should be able to reject invalid sequences in ISO-2022-JP]
expected: FAIL
[decode-non-utf8.any.worker.html]
[TextDecoderStream should be able to reject invalid sequences in Shift_JIS]
expected: FAIL
[TextDecoderStream should be able to decode invalid sequences in Shift_JIS]
expected: FAIL
[TextDecoderStream should be able to reject invalid sequences in UTF-16LE]
expected: FAIL
[TextDecoderStream should be able to reject invalid sequences in UTF-16BE]
expected: FAIL
[TextDecoderStream should be able to decode Shift_JIS]
expected: FAIL
[TextDecoderStream should be able to decode invalid sequences in UTF-16LE]
expected: FAIL
[TextDecoderStream should be able to decode UTF-16BE]
expected: FAIL
[TextDecoderStream should be able to decode invalid sequences in UTF-16BE]
expected: FAIL
[TextDecoderStream should be able to decode UTF-16LE]
expected: FAIL
[TextDecoderStream should be able to decode ISO-8859-14]
expected: FAIL
[TextDecoderStream should be able to decode invalid sequences in ISO-2022-JP]
expected: FAIL
[TextDecoderStream should be able to decode ISO-2022-JP]
expected: FAIL
[TextDecoderStream should be able to reject invalid sequences in ISO-2022-JP]
expected: FAIL
[decode-non-utf8.any.serviceworker.html]
[TextDecoderStream should be able to reject invalid sequences in Shift_JIS]
expected: FAIL
[TextDecoderStream should be able to decode invalid sequences in Shift_JIS]
expected: FAIL
[TextDecoderStream should be able to reject invalid sequences in UTF-16LE]
expected: FAIL
[TextDecoderStream should be able to reject invalid sequences in UTF-16BE]
expected: FAIL
[TextDecoderStream should be able to decode Shift_JIS]
expected: FAIL
[TextDecoderStream should be able to decode invalid sequences in UTF-16LE]
expected: FAIL
[TextDecoderStream should be able to decode UTF-16BE]
expected: FAIL
[TextDecoderStream should be able to decode invalid sequences in UTF-16BE]
expected: FAIL
[TextDecoderStream should be able to decode UTF-16LE]
expected: FAIL
[TextDecoderStream should be able to decode ISO-8859-14]
expected: FAIL
[TextDecoderStream should be able to decode invalid sequences in ISO-2022-JP]
expected: FAIL
[TextDecoderStream should be able to decode ISO-2022-JP]
expected: FAIL
[TextDecoderStream should be able to reject invalid sequences in ISO-2022-JP]
expected: FAIL

Просмотреть файл

@ -1,142 +0,0 @@
[decode-split-character.any.sharedworker.html]
[an empty chunk inside a code point split between chunks should not change the output; split point = 3]
expected: FAIL
[an empty chunk inside a code point split between chunks should not change the output; split point = 1]
expected: FAIL
[an empty chunk inside a code point split between chunks should not change the output; split point = 2]
expected: FAIL
[a code point should be emitted as soon as all bytes are available]
expected: FAIL
[an empty chunk inside a code point split between chunks should not change the output; split point = 4]
expected: FAIL
[an empty chunk inside a code point split between chunks should not change the output; split point = 5]
expected: FAIL
[an empty chunk inside a code point split between chunks should not change the output; split point = 6]
expected: FAIL
[a code point split between chunks should not be emitted until all bytes are available; split point = 4]
expected: FAIL
[a code point split between chunks should not be emitted until all bytes are available; split point = 5]
expected: FAIL
[a code point split between chunks should not be emitted until all bytes are available; split point = 2]
expected: FAIL
[a code point split between chunks should not be emitted until all bytes are available; split point = 3]
expected: FAIL
[decode-split-character.https.any.serviceworker.html]
expected: TIMEOUT
[decode-split-character.any.html]
[an empty chunk inside a code point split between chunks should not change the output; split point = 3]
expected: FAIL
[an empty chunk inside a code point split between chunks should not change the output; split point = 1]
expected: FAIL
[an empty chunk inside a code point split between chunks should not change the output; split point = 2]
expected: FAIL
[a code point should be emitted as soon as all bytes are available]
expected: FAIL
[an empty chunk inside a code point split between chunks should not change the output; split point = 4]
expected: FAIL
[an empty chunk inside a code point split between chunks should not change the output; split point = 5]
expected: FAIL
[an empty chunk inside a code point split between chunks should not change the output; split point = 6]
expected: FAIL
[a code point split between chunks should not be emitted until all bytes are available; split point = 4]
expected: FAIL
[a code point split between chunks should not be emitted until all bytes are available; split point = 5]
expected: FAIL
[a code point split between chunks should not be emitted until all bytes are available; split point = 2]
expected: FAIL
[a code point split between chunks should not be emitted until all bytes are available; split point = 3]
expected: FAIL
[decode-split-character.any.worker.html]
[an empty chunk inside a code point split between chunks should not change the output; split point = 3]
expected: FAIL
[an empty chunk inside a code point split between chunks should not change the output; split point = 1]
expected: FAIL
[an empty chunk inside a code point split between chunks should not change the output; split point = 2]
expected: FAIL
[a code point should be emitted as soon as all bytes are available]
expected: FAIL
[an empty chunk inside a code point split between chunks should not change the output; split point = 4]
expected: FAIL
[an empty chunk inside a code point split between chunks should not change the output; split point = 5]
expected: FAIL
[an empty chunk inside a code point split between chunks should not change the output; split point = 6]
expected: FAIL
[a code point split between chunks should not be emitted until all bytes are available; split point = 4]
expected: FAIL
[a code point split between chunks should not be emitted until all bytes are available; split point = 5]
expected: FAIL
[a code point split between chunks should not be emitted until all bytes are available; split point = 2]
expected: FAIL
[a code point split between chunks should not be emitted until all bytes are available; split point = 3]
expected: FAIL
[decode-split-character.any.serviceworker.html]
[an empty chunk inside a code point split between chunks should not change the output; split point = 3]
expected: FAIL
[an empty chunk inside a code point split between chunks should not change the output; split point = 1]
expected: FAIL
[an empty chunk inside a code point split between chunks should not change the output; split point = 2]
expected: FAIL
[a code point should be emitted as soon as all bytes are available]
expected: FAIL
[an empty chunk inside a code point split between chunks should not change the output; split point = 4]
expected: FAIL
[an empty chunk inside a code point split between chunks should not change the output; split point = 5]
expected: FAIL
[an empty chunk inside a code point split between chunks should not change the output; split point = 6]
expected: FAIL
[a code point split between chunks should not be emitted until all bytes are available; split point = 4]
expected: FAIL
[a code point split between chunks should not be emitted until all bytes are available; split point = 5]
expected: FAIL
[a code point split between chunks should not be emitted until all bytes are available; split point = 2]
expected: FAIL
[a code point split between chunks should not be emitted until all bytes are available; split point = 3]
expected: FAIL

Просмотреть файл

@ -1,16 +1,4 @@
[decode-utf8.any.sharedworker.html]
[decoding one UTF-8 chunk should give one output string - ArrayBuffer]
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1561594
expected: FAIL
[decoding an empty chunk should give no output chunks - ArrayBuffer]
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1561594
expected: FAIL
[an initial empty chunk should be ignored - ArrayBuffer]
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1561594
expected: FAIL
[decoding one UTF-8 chunk should give one output string - SharedArrayBuffer]
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1561594
expected: FAIL
@ -23,20 +11,6 @@
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1561594
expected: FAIL
[decoding a transferred Uint8Array chunk should give no output]
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1561594
expected: FAIL
[decoding a transferred ArrayBuffer chunk should give no output]
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1561594
expected: FAIL
[a trailing empty chunk should be ignored - ArrayBuffer]
expected: FAIL
[UTF-8 EOF handling - ArrayBuffer]
expected: FAIL
[a trailing empty chunk should be ignored - SharedArrayBuffer]
expected: FAIL
@ -45,15 +19,6 @@
[decode-utf8.any.html]
[decoding one UTF-8 chunk should give one output string - ArrayBuffer]
expected: FAIL
[decoding an empty chunk should give no output chunks - ArrayBuffer]
expected: FAIL
[an initial empty chunk should be ignored - ArrayBuffer]
expected: FAIL
[decoding one UTF-8 chunk should give one output string - SharedArrayBuffer]
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1561594
expected: FAIL
@ -66,20 +31,6 @@
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1561594
expected: FAIL
[decoding a transferred Uint8Array chunk should give no output]
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1561594
expected: FAIL
[decoding a transferred ArrayBuffer chunk should give no output]
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1561594
expected: FAIL
[a trailing empty chunk should be ignored - ArrayBuffer]
expected: FAIL
[UTF-8 EOF handling - ArrayBuffer]
expected: FAIL
[a trailing empty chunk should be ignored - SharedArrayBuffer]
expected: FAIL
@ -88,15 +39,6 @@
[decode-utf8.any.worker.html]
[decoding one UTF-8 chunk should give one output string - ArrayBuffer]
expected: FAIL
[decoding an empty chunk should give no output chunks - ArrayBuffer]
expected: FAIL
[an initial empty chunk should be ignored - ArrayBuffer]
expected: FAIL
[decoding one UTF-8 chunk should give one output string - SharedArrayBuffer]
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1561594
expected: FAIL
@ -109,20 +51,6 @@
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1561594
expected: FAIL
[decoding a transferred Uint8Array chunk should give no output]
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1561594
expected: FAIL
[decoding a transferred ArrayBuffer chunk should give no output]
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1561594
expected: FAIL
[a trailing empty chunk should be ignored - ArrayBuffer]
expected: FAIL
[UTF-8 EOF handling - ArrayBuffer]
expected: FAIL
[a trailing empty chunk should be ignored - SharedArrayBuffer]
expected: FAIL
@ -135,33 +63,12 @@
[decoding one UTF-8 chunk should give one output string - SharedArrayBuffer]
expected: FAIL
[decoding one UTF-8 chunk should give one output string - ArrayBuffer]
expected: FAIL
[an initial empty chunk should be ignored - ArrayBuffer]
expected: FAIL
[an initial empty chunk should be ignored - SharedArrayBuffer]
expected: FAIL
[decoding a transferred Uint8Array chunk should give no output]
expected: FAIL
[decoding an empty chunk should give no output chunks - SharedArrayBuffer]
expected: FAIL
[decoding an empty chunk should give no output chunks - ArrayBuffer]
expected: FAIL
[decoding a transferred ArrayBuffer chunk should give no output]
expected: FAIL
[a trailing empty chunk should be ignored - ArrayBuffer]
expected: FAIL
[UTF-8 EOF handling - ArrayBuffer]
expected: FAIL
[a trailing empty chunk should be ignored - SharedArrayBuffer]
expected: FAIL

Просмотреть файл

@ -1,82 +0,0 @@
[encode-bad-chunks.any.html]
[a chunk that cannot be converted to a string should error the streams]
expected: FAIL
[input of type numeric should be converted correctly to string]
expected: FAIL
[input of type undefined should be converted correctly to string]
expected: FAIL
[input of type array should be converted correctly to string]
expected: FAIL
[input of type object should be converted correctly to string]
expected: FAIL
[input of type null should be converted correctly to string]
expected: FAIL
[encode-bad-chunks.any.worker.html]
[a chunk that cannot be converted to a string should error the streams]
expected: FAIL
[input of type numeric should be converted correctly to string]
expected: FAIL
[input of type undefined should be converted correctly to string]
expected: FAIL
[input of type array should be converted correctly to string]
expected: FAIL
[input of type object should be converted correctly to string]
expected: FAIL
[input of type null should be converted correctly to string]
expected: FAIL
[encode-bad-chunks.any.sharedworker.html]
[a chunk that cannot be converted to a string should error the streams]
expected: FAIL
[input of type numeric should be converted correctly to string]
expected: FAIL
[input of type undefined should be converted correctly to string]
expected: FAIL
[input of type array should be converted correctly to string]
expected: FAIL
[input of type object should be converted correctly to string]
expected: FAIL
[input of type null should be converted correctly to string]
expected: FAIL
[encode-bad-chunks.https.any.serviceworker.html]
expected: TIMEOUT
[encode-bad-chunks.any.serviceworker.html]
[a chunk that cannot be converted to a string should error the streams]
expected: FAIL
[input of type numeric should be converted correctly to string]
expected: FAIL
[input of type undefined should be converted correctly to string]
expected: FAIL
[input of type array should be converted correctly to string]
expected: FAIL
[input of type object should be converted correctly to string]
expected: FAIL
[input of type null should be converted correctly to string]
expected: FAIL

Просмотреть файл

@ -1,238 +0,0 @@
[encode-utf8.https.any.serviceworker.html]
expected: TIMEOUT
[encode-utf8.any.worker.html]
[two leading chunks should result in two replacement characters]
expected: FAIL
[characters in the ISO-8859-1 range should be encoded correctly]
expected: FAIL
[a terminal unpaired trailing surrogate should immediately be replaced]
expected: FAIL
[a character split between chunks should be correctly encoded]
expected: FAIL
[an empty string should result in no output chunk]
expected: FAIL
[an unmatched surrogate at the end of a chunk followed by an ascii character in the next chunk should be replaced with the replacement character at the start of the next output chunk]
expected: FAIL
[a leading empty chunk should be ignored]
expected: FAIL
[encoding one string of UTF-8 should give one complete chunk]
expected: FAIL
[a leading surrogate chunk should be carried past empty chunks]
expected: FAIL
[a leading surrogate chunk should error when it is clear it didn't form a pair]
expected: FAIL
[a trailing empty chunk should be ignored]
expected: FAIL
[a plain ASCII chunk should be converted]
expected: FAIL
[a character following one split between chunks should be correctly encoded]
expected: FAIL
[an unmatched surrogate at the end of a chunk followed by a plane 1 character split into two chunks should result in the encoded plane 1 character appearing in the last output chunk]
expected: FAIL
[an unmatched surrogate at the end of a chunk followed by an astral character in the next chunk should be replaced with the replacement character at the start of the next output chunk]
expected: FAIL
[two consecutive astral characters each split down the middle should be correctly reassembled]
expected: FAIL
[a non-terminal unpaired leading surrogate should immediately be replaced]
expected: FAIL
[two consecutive astral characters each split down the middle with an invalid surrogate in the middle should be correctly encoded]
expected: FAIL
[a stream ending in a leading surrogate should emit a replacement character as a final chunk]
expected: FAIL
[encode-utf8.any.html]
[two leading chunks should result in two replacement characters]
expected: FAIL
[characters in the ISO-8859-1 range should be encoded correctly]
expected: FAIL
[a terminal unpaired trailing surrogate should immediately be replaced]
expected: FAIL
[a character split between chunks should be correctly encoded]
expected: FAIL
[an empty string should result in no output chunk]
expected: FAIL
[an unmatched surrogate at the end of a chunk followed by an ascii character in the next chunk should be replaced with the replacement character at the start of the next output chunk]
expected: FAIL
[a leading empty chunk should be ignored]
expected: FAIL
[encoding one string of UTF-8 should give one complete chunk]
expected: FAIL
[a leading surrogate chunk should be carried past empty chunks]
expected: FAIL
[a leading surrogate chunk should error when it is clear it didn't form a pair]
expected: FAIL
[a trailing empty chunk should be ignored]
expected: FAIL
[a plain ASCII chunk should be converted]
expected: FAIL
[a character following one split between chunks should be correctly encoded]
expected: FAIL
[an unmatched surrogate at the end of a chunk followed by a plane 1 character split into two chunks should result in the encoded plane 1 character appearing in the last output chunk]
expected: FAIL
[an unmatched surrogate at the end of a chunk followed by an astral character in the next chunk should be replaced with the replacement character at the start of the next output chunk]
expected: FAIL
[two consecutive astral characters each split down the middle should be correctly reassembled]
expected: FAIL
[a non-terminal unpaired leading surrogate should immediately be replaced]
expected: FAIL
[two consecutive astral characters each split down the middle with an invalid surrogate in the middle should be correctly encoded]
expected: FAIL
[a stream ending in a leading surrogate should emit a replacement character as a final chunk]
expected: FAIL
[encode-utf8.any.sharedworker.html]
[two leading chunks should result in two replacement characters]
expected: FAIL
[characters in the ISO-8859-1 range should be encoded correctly]
expected: FAIL
[a terminal unpaired trailing surrogate should immediately be replaced]
expected: FAIL
[a character split between chunks should be correctly encoded]
expected: FAIL
[an empty string should result in no output chunk]
expected: FAIL
[an unmatched surrogate at the end of a chunk followed by an ascii character in the next chunk should be replaced with the replacement character at the start of the next output chunk]
expected: FAIL
[a leading empty chunk should be ignored]
expected: FAIL
[encoding one string of UTF-8 should give one complete chunk]
expected: FAIL
[a leading surrogate chunk should be carried past empty chunks]
expected: FAIL
[a leading surrogate chunk should error when it is clear it didn't form a pair]
expected: FAIL
[a trailing empty chunk should be ignored]
expected: FAIL
[a plain ASCII chunk should be converted]
expected: FAIL
[a character following one split between chunks should be correctly encoded]
expected: FAIL
[an unmatched surrogate at the end of a chunk followed by a plane 1 character split into two chunks should result in the encoded plane 1 character appearing in the last output chunk]
expected: FAIL
[an unmatched surrogate at the end of a chunk followed by an astral character in the next chunk should be replaced with the replacement character at the start of the next output chunk]
expected: FAIL
[two consecutive astral characters each split down the middle should be correctly reassembled]
expected: FAIL
[a non-terminal unpaired leading surrogate should immediately be replaced]
expected: FAIL
[two consecutive astral characters each split down the middle with an invalid surrogate in the middle should be correctly encoded]
expected: FAIL
[a stream ending in a leading surrogate should emit a replacement character as a final chunk]
expected: FAIL
[encode-utf8.any.serviceworker.html]
[two leading chunks should result in two replacement characters]
expected: FAIL
[characters in the ISO-8859-1 range should be encoded correctly]
expected: FAIL
[a terminal unpaired trailing surrogate should immediately be replaced]
expected: FAIL
[a character split between chunks should be correctly encoded]
expected: FAIL
[an empty string should result in no output chunk]
expected: FAIL
[an unmatched surrogate at the end of a chunk followed by an ascii character in the next chunk should be replaced with the replacement character at the start of the next output chunk]
expected: FAIL
[a leading empty chunk should be ignored]
expected: FAIL
[encoding one string of UTF-8 should give one complete chunk]
expected: FAIL
[a leading surrogate chunk should be carried past empty chunks]
expected: FAIL
[a leading surrogate chunk should error when it is clear it didn't form a pair]
expected: FAIL
[a trailing empty chunk should be ignored]
expected: FAIL
[a plain ASCII chunk should be converted]
expected: FAIL
[a character following one split between chunks should be correctly encoded]
expected: FAIL
[an unmatched surrogate at the end of a chunk followed by a plane 1 character split into two chunks should result in the encoded plane 1 character appearing in the last output chunk]
expected: FAIL
[an unmatched surrogate at the end of a chunk followed by an astral character in the next chunk should be replaced with the replacement character at the start of the next output chunk]
expected: FAIL
[two consecutive astral characters each split down the middle should be correctly reassembled]
expected: FAIL
[a non-terminal unpaired leading surrogate should immediately be replaced]
expected: FAIL
[two consecutive astral characters each split down the middle with an invalid surrogate in the middle should be correctly encoded]
expected: FAIL
[a stream ending in a leading surrogate should emit a replacement character as a final chunk]
expected: FAIL

Просмотреть файл

@ -1,34 +0,0 @@
[readable-writable-properties.any.sharedworker.html]
[TextDecoderStream readable and writable properties must pass brand checks]
expected: FAIL
[TextEncoderStream readable and writable properties must pass brand checks]
expected: FAIL
[readable-writable-properties.https.any.serviceworker.html]
expected: TIMEOUT
[readable-writable-properties.any.html]
[TextDecoderStream readable and writable properties must pass brand checks]
expected: FAIL
[TextEncoderStream readable and writable properties must pass brand checks]
expected: FAIL
[readable-writable-properties.any.worker.html]
[TextDecoderStream readable and writable properties must pass brand checks]
expected: FAIL
[TextEncoderStream readable and writable properties must pass brand checks]
expected: FAIL
[readable-writable-properties.any.serviceworker.html]
[TextDecoderStream readable and writable properties must pass brand checks]
expected: FAIL
[TextEncoderStream readable and writable properties must pass brand checks]
expected: FAIL

Просмотреть файл

@ -1,36 +1,6 @@
[realms.window.html]
[a TextEncoderStream object should be associated with the realm the constructor came from]
expected: FAIL
[TextEncoderStream's readable and writable attributes should come from the same realm as the constructor definition]
expected: FAIL
[the output chunks when read is called after write should come from the same realm as the constructor of TextEncoderStream]
expected: FAIL
[the output chunks when write is called with a pending read should come from the same realm as the constructor of TextEncoderStream]
expected: FAIL
[TypeError for unconvertable chunk should come from constructor realm of TextEncoderStream]
expected: FAIL
[a TextDecoderStream object should be associated with the realm the constructor came from]
expected: FAIL
[TextDecoderStream's readable and writable attributes should come from the same realm as the constructor definition]
expected: FAIL
[the result object when read is called after write should come from the same realm as the constructor of TextDecoderStream]
expected: FAIL
[the result object when write is called with a pending read should come from the same realm as the constructor of TextDecoderStream]
expected: FAIL
[TypeError for chunk with the wrong type should come from constructor realm of TextDecoderStream]
expected: FAIL
[TypeError for invalid chunk should come from constructor realm of TextDecoderStream]
expected: FAIL
[TypeError for incomplete input should come from constructor realm of TextDecoderStream]
expected: FAIL