Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(366)

Issue 23532016: Handle odd data lengths in UTF-16 decoder (Closed)

Created:
7 years, 3 months ago by jsbell
Modified:
6 years, 9 months ago
CC:
blink-reviews, loislo+blink_chromium.org, eae+blinkwatch, yurys+blink_chromium.org, dglazkov+blink, adamk+blink_chromium.org, jeez
Visibility:
Public.

Description

Handle odd data lengths in UTF-16 decoder The UTF-16 decoder was silently dropping ignoring odd byte lengths. Per the Encoding standard, it should emit U+FFFD (replacement char), and set the error flag for interested callers. This makes TextDecoder match the behavior in Firefox. BUG=277035 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=168763

Patch Set 1 #

Patch Set 2 : Fix bad UTF-16 test file, add corresponding test #

Patch Set 3 : Add streaming test cases #

Patch Set 4 : Rebase now that binary files have landed #

Patch Set 5 : Rebased #

Total comments: 1

Patch Set 6 : Eschew String::append #

Patch Set 7 : Rebased #

Patch Set 8 : Match FF behavior - don't flush at end of fetch #

Patch Set 9 : Rebase following r163178 #

Patch Set 10 : Add tests for truncated multibyte sequences #

Patch Set 11 : Rebased #

Patch Set 12 : Make flush behavior configurable #

Patch Set 13 : Simplify #

Unified diffs Side-by-side diffs Delta from patch set Stats (+151 lines, -62 lines) Patch
M LayoutTests/fast/encoding/api/end-of-file.html View 1 2 3 4 5 6 7 1 chunk +15 lines, -6 lines 0 comments Download
M LayoutTests/fast/encoding/api/end-of-file-expected.txt View 1 2 3 4 5 6 7 8 1 chunk +15 lines, -8 lines 0 comments Download
M LayoutTests/fast/encoding/api/fatal-flag-expected.txt View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
A LayoutTests/fast/encoding/char-decoding-truncated.html View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +31 lines, -0 lines 0 comments Download
A LayoutTests/fast/encoding/char-decoding-truncated-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +26 lines, -0 lines 0 comments Download
M LayoutTests/fast/encoding/resources/char-decoding-utils.js View 1 2 3 4 5 6 7 8 9 3 chunks +2 lines, -14 lines 0 comments Download
M Source/core/dom/Document.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/parser/TextResourceDecoder.cpp View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +2 lines, -2 lines 0 comments Download
M Source/modules/encoding/TextDecoder.cpp View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -4 lines 0 comments Download
M Source/wtf/text/TextCodec.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +18 lines, -2 lines 0 comments Download
M Source/wtf/text/TextCodecICU.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
M Source/wtf/text/TextCodecICU.cpp View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +2 lines, -2 lines 0 comments Download
M Source/wtf/text/TextCodecLatin1.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
M Source/wtf/text/TextCodecLatin1.cpp View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
M Source/wtf/text/TextCodecUTF16.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
M Source/wtf/text/TextCodecUTF16.cpp View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +25 lines, -10 lines 0 comments Download
M Source/wtf/text/TextCodecUTF8.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
M Source/wtf/text/TextCodecUTF8.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M Source/wtf/text/TextCodecUTF8Test.cpp View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +3 lines, -3 lines 0 comments Download
M Source/wtf/text/TextCodecUserDefined.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
M Source/wtf/text/TextCodecUserDefined.cpp View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
M Source/wtf/text/TextEncoding.cpp View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 39 (0 generated)
jsbell
Uploading for the try bots, but not ready for landing yet. This needs an additional ...
7 years, 3 months ago (2013-08-30 00:11:29 UTC) #1
jsbell
Heh, the test-unicode-characters-in-attribute-name.html file is UTF-16 encoded but had a lone trailing byte, so the ...
7 years, 3 months ago (2013-08-30 17:21:41 UTC) #2
jsbell
On 2013/08/30 17:21:41, jsbell wrote: > Heh, the test-unicode-characters-in-attribute-name.html file is UTF-16 encoded > but ...
7 years, 3 months ago (2013-08-30 18:15:49 UTC) #3
jungshik at Google
I guess "LayoutTests/fast/encoding/utf-16-odd-byte.html" has a string in the corresponding expected file in UTF-16 (+ 1 ...
7 years, 3 months ago (2013-08-30 18:22:04 UTC) #4
jungshik at Google
On 2013/08/30 18:22:04, Jungshik Shin wrote: > I guess "LayoutTests/fast/encoding/utf-16-odd-byte.html" has a string in the ...
7 years, 3 months ago (2013-08-30 18:23:37 UTC) #5
jsbell
On 2013/08/30 18:23:37, Jungshik Shin wrote: > On 2013/08/30 18:22:04, Jungshik Shin wrote: > > ...
7 years, 3 months ago (2013-08-30 18:40:23 UTC) #6
Ken Russell (switch to Gerrit)
lgtm
7 years, 3 months ago (2013-08-30 21:26:23 UTC) #7
jsbell
The http/tests/appcache/online-whitelist.html failure looks unrelated... appears to be flaky in other runs.
7 years, 3 months ago (2013-09-03 17:54:27 UTC) #8
jsbell
On 2013/09/03 17:54:27, jsbell wrote: > The http/tests/appcache/online-whitelist.html failure looks unrelated... appears > to be ...
7 years, 3 months ago (2013-09-03 18:17:27 UTC) #9
jsbell
jamesr@ - OWNERS review for Source/wtf?
7 years, 3 months ago (2013-09-03 18:18:11 UTC) #10
jamesr
Have you run this test case on other browsers? I'm a little worried about corner ...
7 years, 3 months ago (2013-09-04 22:31:31 UTC) #11
jsbell
On 2013/09/04 22:31:31, jamesr wrote: > Have you run this test case on other browsers? ...
7 years, 3 months ago (2013-09-04 23:45:16 UTC) #12
jamesr
There's a recent thread on WHATWG titled "Encoding: lone surrogates and utf-8, utf-16be, and utf-16le ...
7 years, 3 months ago (2013-09-04 23:46:48 UTC) #13
jsbell
On 2013/09/04 23:46:48, jamesr wrote: > There's a recent thread on WHATWG titled "Encoding: lone ...
7 years, 3 months ago (2013-09-05 00:03:19 UTC) #14
abarth-chromium
Seems like reasonable behavior to me, but I haven't read the spec. https://codereview.chromium.org/23532016/diff/19001/Source/wtf/text/TextCodecUTF16.cpp File Source/wtf/text/TextCodecUTF16.cpp ...
7 years, 3 months ago (2013-09-05 05:57:51 UTC) #15
jsbell
On 2013/09/05 05:57:51, abarth wrote: > The idiom you want here is: > > return ...
7 years, 3 months ago (2013-09-05 15:45:10 UTC) #16
jsbell
On 2013/09/05 15:45:10, jsbell wrote: > > I'll check IE. If none of us are ...
7 years, 3 months ago (2013-09-05 15:52:26 UTC) #17
jungshik at Google
On 2013/09/05 15:52:26, jsbell wrote: > On 2013/09/05 15:45:10, jsbell wrote: > > > > ...
7 years, 3 months ago (2013-09-05 19:50:07 UTC) #18
abarth-chromium
On 2013/09/05 19:50:07, Jungshik Shin wrote: > If Firefox regards it as a bug (which ...
7 years, 3 months ago (2013-09-06 05:09:35 UTC) #19
jsbell
On 2013/09/06 05:09:35, abarth wrote: > On 2013/09/05 19:50:07, Jungshik Shin wrote: > > If ...
7 years, 3 months ago (2013-09-06 15:50:48 UTC) #20
jsbell
On 2013/09/06 15:50:48, jsbell wrote: > On 2013/09/06 05:09:35, abarth wrote: > > On 2013/09/05 ...
7 years, 2 months ago (2013-10-08 21:45:36 UTC) #21
jsbell
Throwing this out for review again. Since it was last reviewed by jshin@ and abarth@: ...
7 years ago (2013-12-06 22:43:33 UTC) #22
jsbell
Pinging again - see previous comment on the CL: jshin@ - what do you think? ...
7 years ago (2013-12-20 18:25:24 UTC) #23
jungshik at Google
On 2013/12/20 18:25:24, jsbell wrote: > Pinging again - see previous comment on the CL: ...
6 years, 11 months ago (2014-01-02 19:07:48 UTC) #24
jsbell
On 2014/01/02 19:07:48, Jungshik Shin wrote: > On 2013/12/20 18:25:24, jsbell wrote: > > Pinging ...
6 years, 11 months ago (2014-01-02 19:19:30 UTC) #25
jungshik at Google
On 2014/01/02 19:19:30, jsbell wrote: > On 2014/01/02 19:07:48, Jungshik Shin wrote: > > On ...
6 years, 11 months ago (2014-01-02 23:28:08 UTC) #26
abarth-chromium
lgtm
6 years, 11 months ago (2014-01-04 05:26:41 UTC) #27
abarth-chromium
On 2014/01/04 05:26:41, abarth wrote: > lgtm Sorry, I missed the rest of this thread ...
6 years, 11 months ago (2014-01-04 05:42:00 UTC) #28
jsbell
I wasn't satisfied with the last patch since it made us *less* standard, even if ...
6 years, 9 months ago (2014-02-28 22:29:24 UTC) #29
Ken Russell (switch to Gerrit)
On 2014/02/28 22:29:24, jsbell wrote: > I wasn't satisfied with the last patch since it ...
6 years, 9 months ago (2014-02-28 23:21:43 UTC) #30
jsbell
Friendly ping - the patch has been substantially reworked so I'm discounting the above l*g*t*ms. ...
6 years, 9 months ago (2014-03-06 18:39:31 UTC) #31
abarth-chromium
Still LGTM. Thanks!
6 years, 9 months ago (2014-03-06 22:02:54 UTC) #32
jsbell
The CQ bit was checked by jsbell@chromium.org
6 years, 9 months ago (2014-03-07 18:22:15 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jsbell@chromium.org/23532016/282001
6 years, 9 months ago (2014-03-07 18:22:28 UTC) #34
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-07 18:58:34 UTC) #35
commit-bot: I haz the power
Try jobs failed on following builders: linux_blink_rel
6 years, 9 months ago (2014-03-07 18:58:35 UTC) #36
jsbell
The CQ bit was checked by jsbell@chromium.org
6 years, 9 months ago (2014-03-07 21:31:40 UTC) #37
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jsbell@chromium.org/23532016/282001
6 years, 9 months ago (2014-03-07 21:31:48 UTC) #38
commit-bot: I haz the power
6 years, 9 months ago (2014-03-08 03:53:02 UTC) #39
Message was sent while issue was closed.
Change committed as 168763

Powered by Google App Engine
This is Rietveld 408576698