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

Issue 19845004: Do not normalize into NFC the values of form fields (Closed)

Created:
7 years, 5 months ago by dtrebbien
Modified:
7 years, 5 months ago
CC:
blink-reviews, loislo+blink_chromium.org, eae+blinkwatch, yurys+blink_chromium.org, dglazkov+blink, adamk+blink_chromium.org, jeez
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

Do not normalize into NFC the values of form fields This commit renames the TextEncoding::encode(const String&, UnencodableHandling) const API function to normalizeAndEncode() to make clear that the function first applies Unicode NFC normalization before encoding the string. All existing references to encode() except for one were updated to call normalizeAndEncode() instead. TextEncoding::encode(const String&, UnencodableHandling) const is added back as a new API function which only encodes the string, but does not normalize the string before encoding. The one call to the old encode() function that was not updated is in FormDataList::appendString(const String&). This was left as a call to the new encode() to fix Issue 117128. Chrome and Safari are unlike other browsers in that they apply Unicode NFC normalization to form values when submitting a form; in particular, the following browsers were tested and found not to normalize the form values: - Firefox 22.0 - Firefox ESR 17.0.7 - Opera 12.16 - IE 6 - IE 7 - IE 8 - IE 9 - IE 10 - Amaya 11.4.7 NFC normalization actually changes the meaning of text in certain scripts. Notably, there are certain Biblical Hebrew words for which normalization causes the word to be erroneously encoded. One example is given on page 9 of the SBL Hebrew Font User Manual version 1.5: http://www.sbl-site.org/Fonts/SBLHebrewManualv1.5.pdf This example is added as the new form-data-encoding-3.html layout test. BUG=117128 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=154881

Patch Set 1 #

Total comments: 1

Patch Set 2 : Add normalizeAndEncode() #

Total comments: 1

Patch Set 3 : Add normalizeAndEncode() without memory safety problem #

Unified diffs Side-by-side diffs Delta from patch set Stats (+77 lines, -16 lines) Patch
M LayoutTests/fast/forms/form-data-encoding.html View 2 chunks +2 lines, -2 lines 0 comments Download
M LayoutTests/fast/forms/form-data-encoding-2.html View 2 chunks +2 lines, -2 lines 0 comments Download
A LayoutTests/fast/forms/form-data-encoding-3.html View 1 chunk +43 lines, -0 lines 0 comments Download
A + LayoutTests/fast/forms/form-data-encoding-3-expected.txt View 0 chunks +-1 lines, --1 lines 0 comments Download
M Source/core/fileapi/BlobBuilder.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/page/PageSerializer.cpp View 1 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/platform/network/FormDataBuilder.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/xml/XMLHttpRequest.cpp View 1 2 chunks +2 lines, -2 lines 0 comments Download
M Source/web/WebPageSerializerImpl.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/weborigin/KURL.cpp View 1 2 chunks +2 lines, -2 lines 0 comments Download
M Source/wtf/text/TextEncoding.h View 1 1 chunk +5 lines, -0 lines 0 comments Download
M Source/wtf/text/TextEncoding.cpp View 1 2 2 chunks +17 lines, -4 lines 0 comments Download

Messages

Total messages: 15 (0 generated)
dtrebbien
Hello Kent, Would you please review this CL for http://code.google.com/p/chromium/issues/detail?id=117128 ? If someone else should ...
7 years, 5 months ago (2013-07-21 21:03:12 UTC) #1
abarth-chromium
Can you add more information about why we should make this change and how other ...
7 years, 5 months ago (2013-07-22 00:01:36 UTC) #2
dtrebbien
On 2013/07/22 00:01:36, abarth wrote: > Can you add more information about why we should ...
7 years, 5 months ago (2013-07-22 12:13:37 UTC) #3
tkent
On 2013/07/22 12:13:37, dtrebbien wrote: > On 2013/07/22 00:01:36, abarth wrote: > > Can you ...
7 years, 5 months ago (2013-07-22 23:36:23 UTC) #4
tkent
https://codereview.chromium.org/19845004/diff/1/Source/wtf/text/TextEncoding.h File Source/wtf/text/TextEncoding.h (right): https://codereview.chromium.org/19845004/diff/1/Source/wtf/text/TextEncoding.h#newcode76 Source/wtf/text/TextEncoding.h:76: CString encode(const String&, UnencodableHandling) const; IMO, we had better ...
7 years, 5 months ago (2013-07-22 23:38:08 UTC) #5
dtrebbien
Amaya 11.4.7 sends input1=a%cc%88&input2=%c3%a4 Safari 6.0.5 normalizes the data just like Chrome, sending input1=%C3%A4&input2=%C3%A4
7 years, 5 months ago (2013-07-23 11:41:28 UTC) #6
dtrebbien
On 2013/07/22 23:38:08, tkent wrote: > https://codereview.chromium.org/19845004/diff/1/Source/wtf/text/TextEncoding.h > File Source/wtf/text/TextEncoding.h (right): > > https://codereview.chromium.org/19845004/diff/1/Source/wtf/text/TextEncoding.h#newcode76 > ...
7 years, 5 months ago (2013-07-23 13:39:16 UTC) #7
tkent
lgtm. Thank you!
7 years, 5 months ago (2013-07-24 00:05:08 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dtrebbien@gmail.com/19845004/9001
7 years, 5 months ago (2013-07-24 00:06:03 UTC) #9
commit-bot: I haz the power
Retried try job too often on blink_presubmit for step(s) presubmit http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=blink_presubmit&number=4093
7 years, 5 months ago (2013-07-24 00:18:57 UTC) #10
tkent
Ah, this needs a weborigin OWNER.
7 years, 5 months ago (2013-07-24 00:23:30 UTC) #11
abarth-chromium
Thank you for the improved description. That makes this CL much easier to review. Unfortunately, ...
7 years, 5 months ago (2013-07-24 18:20:09 UTC) #12
dtrebbien
On 2013/07/24 18:20:09, abarth wrote: > Thank you for the improved description. That makes this ...
7 years, 5 months ago (2013-07-24 23:18:37 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dtrebbien@gmail.com/19845004/22001
7 years, 5 months ago (2013-07-24 23:26:59 UTC) #14
commit-bot: I haz the power
7 years, 5 months ago (2013-07-25 02:16:59 UTC) #15
Message was sent while issue was closed.
Change committed as 154881

Powered by Google App Engine
This is Rietveld 408576698