Repository navigation
Conversation
When decode() threw while streaming, the next invocation continued with the decoder, I/O queue, and BOM seen as they were when the error occurred. As the output up to the error is not returned, continuing from there is not useful, and implementations disagreed on what remained. Instead the next invocation now starts anew. TextDecoderStream is unaffected, as an error there errors the stream. Also remove the "Otherwise" steps that follow early returns in decode(), which removes a level of nesting. Fixes #358 and fixes #359.
hsivonen
approved these changes
Nov 18, 2026
Member
|
It seems I don't have the permission to edit the issue, but the Gecko implementation bug is: https://bugzilla.mozilla.org/show_bug.cgi?id=2094779 |
annevk
added a commit
to annevk/WebKit
that referenced
this pull request
Nov 19, 2026
https://bugs.webkit.org/show_bug.cgi?id=332174 rdar://193118928 Reviewed by NOBODY (OOPS!). The Encoding Standard now has a decode() call that throws reset the decoder, so that the next call doesn't continue with state from before the error, such as the ISO-2022-JP mode or whether a BOM was seen: whatwg/encoding#369 security/decode-buffer-size.html relied on that state for its second exception, so give that decode() call its own partial sequence. Tests: imported/w3c/web-platform-tests/encoding/textdecoder-fatal-streaming.any.html imported/w3c/web-platform-tests/encoding/textdecoder-mistakes.any.html security/decode-buffer-size.html
This was referenced Nov 19, 2026
annevk
added a commit
to annevk/WebKit
that referenced
this pull request
Nov 20, 2026
https://bugs.webkit.org/show_bug.cgi?id=332174 rdar://193118928 Reviewed by NOBODY (OOPS!). The Encoding Standard now has a decode() call that throws reset the decoder, so that the next call doesn't continue with state from before the error, such as the ISO-2022-JP mode or whether a BOM was seen: whatwg/encoding#369 security/decode-buffer-size.html relied on that state for its second exception, so give that decode() call its own partial sequence. Tests: imported/w3c/web-platform-tests/encoding/textdecoder-fatal-streaming.any.html imported/w3c/web-platform-tests/encoding/textdecoder-mistakes.any.html security/decode-buffer-size.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When decode() threw while streaming, the next invocation continued with the decoder, I/O queue, and BOM seen as they were when the error occurred. As the output up to the error is not returned, continuing from there is not useful, and implementations disagreed on what remained. Instead the next invocation now starts anew.
TextDecoderStream is unaffected, as an error there errors the stream.
Also remove the "Otherwise" steps that follow early returns in decode(), which removes a level of nesting.
Fixes #358 and fixes #359.
(See WHATWG Working Mode: Changes for more details.)
Preview | Diff