Bug 216108 - TextDecoder should ignore byte-order-mark like other browsers and spec
Summary: TextDecoder should ignore byte-order-mark like other browsers and spec
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alex Christensen
URL:
Keywords: InRadar
: 169858 203832 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-09-02 16:42 PDT by Alex Christensen
Modified: 2020-09-03 09:59 PDT (History)
9 users (show)

See Also:


Attachments
Patch (3.98 KB, patch)
2020-09-02 16:43 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (9.82 KB, patch)
2020-09-02 21:19 PDT, Alex Christensen
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Christensen 2020-09-02 16:42:26 PDT
TextDecoder should ignore byte-order-mark like other browsers and spec
Comment 1 Alex Christensen 2020-09-02 16:43:01 PDT
Created attachment 407831 [details]
Patch
Comment 2 Alexey Proskuryakov 2020-09-02 18:10:32 PDT
Is this a dupe of bug 169858 or a dupe of bug 203832? Both, I guess.
Comment 3 Alex Christensen 2020-09-02 20:06:55 PDT
*** Bug 169858 has been marked as a duplicate of this bug. ***
Comment 4 Alex Christensen 2020-09-02 20:07:20 PDT
*** Bug 203832 has been marked as a duplicate of this bug. ***
Comment 5 Alex Christensen 2020-09-02 21:19:33 PDT
Created attachment 407864 [details]
Patch
Comment 6 Alex Christensen 2020-09-03 09:37:24 PDT
Comment on attachment 407864 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=407864&action=review

> Source/WebCore/dom/TextDecoder.cpp:72
> +    if (stream && length < bytesNeededForFullBOMIgnoreCheck())
> +        return WaitForMoreBOMBytes::Yes;

I also need to check if the bytes start with what may become a byte order mark here.  If they're other bytes, I need to return WaitForMoreBOMBytes::No
Comment 7 Darin Adler 2020-09-03 09:57:58 PDT
Comment on attachment 407864 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=407864&action=review

>> Source/WebCore/dom/TextDecoder.cpp:72
>> +        return WaitForMoreBOMBytes::Yes;
> 
> I also need to check if the bytes start with what may become a byte order mark here.  If they're other bytes, I need to return WaitForMoreBOMBytes::No

I guess the function would have a name like isBOMPrefix.
Comment 8 Alex Christensen 2020-09-03 09:58:03 PDT
http://trac.webkit.org/r266528
Comment 9 Radar WebKit Bug Importer 2020-09-03 09:59:27 PDT
<rdar://problem/68285403>