New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 661819 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Nov 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocked on:
issue 662146



Sign in to add a comment

Use HTML-style numeric character references rather than '?' when form upload filename character does not map to form's accept-charset

Project Member Reported by bsittler@chromium.org, Nov 2 2016

Issue description

Version: 56.0.2905.0 (Official Build) canary (64-bit)
OS: ChromeOS

What steps will reproduce the problem?
(1) Open:
data:text/html;charset=utf-8,<form accept-charset="windows-1252" method=POST enctype="multipart/form-data" action="https://postman-echo.com/post"><ol><li><a download="U&%23xE2;&%23x2DC;&%23xBA;%E2%98%BA.U&%23xE2;&%23x2DC;&%23xBA;%E2%98%BA" href="data:application/octet-stream,U%C3%A2%C2%98%C2%BA%E2%98%BA">download</a><li><input type=file name="q"><li><input type=submit value=upload></ol></form>
(2) Follow instructions: download, then choose downloaded file, then upload
(3) Note upload filename as seen by server (right after "files"). (NOTE: this CGI always labels the response as UTF-8 even though in this case it isn't actually - however the test data and filename have been modified to work around that)

What is the expected output?

Unrepresentable characters converted to HTML numeric character references "&#NNNNNNN;":

{"args":{},"data":{},"files":{"U☺&#9786;.U☺&#9786;":...

Firefox does something like this, except each uploaded filename is prefixed by tmp_<number> and suffixed with a different <number> in Firefox too, which we probably don't need to do:

{"args":{},"data":{},"files":{"tmp_7163-U☺&#9786;1556538326.U☺&#9786;":...

What do you see instead?

Unrepresentable characters are converted to "?":

{"args":{},"data":{},"files":{"U☺?.U☺?":...


Please use labels and text to provide additional information.

 
WebKit has FIXMEs BTW for both filename=... and name=... irreversible character encoding loss: https://github.com/WebKit/webkit/blob/master/Source/WebCore/platform/network/FormDataBuilder.cpp#L144 https://github.com/WebKit/webkit/blob/master/Source/WebCore/platform/network/FormDataBuilder.cpp#L124
although it appears that one of those might actually be obsolete.

I believe HTML5 gets its definition of the filename="..." C-D field for multipart form uploads from https://tools.ietf.org/html/rfc7578#section-4.2 which isn't clear about what to do with outside-of-charset characters in the filename.

firefox does one thing (entification), chrome/webkit another (?-replacement)

ie/edge behavior not yet tested
Also: if we fix this, WTF::QuestionMarksForUnencodables and all associated complexity can disappear from the entire codebase.
Blockedon: 662146

Comment 4 by tkent@chromium.org, Nov 4 2016

Components: -Blink>Forms Blink>Forms>Submission
Labels: Hotlist-Interop
Status: Available (was: Untriaged)
Edge:
It seems C-D header is encoded for the page encoding.  So, if the page encoding is UTF-8, UTF-8-encoded bytes are sent.
If the page encoding is windows-1252, &#xE2;&#x98;&#xBA; are sent as is, and ☺ is encoded as &#9786.

So, we should use numeric references for interoperability.

Comment 5 by js...@chromium.org, Nov 4 2016

Cc: js...@chromium.org
At first, I thought it'd be best to use RFC 5987 (always with UTF-8), but RFC 7578 has the following: 
NOTE: The encoding method described in [RFC5987], which would add a
   "filename*" parameter to the Content-Disposition header field, MUST
   NOT be used.

RFC 5987 has a similar note. 

Great! Looks like Edge, Firefox have matching less-lossy behavior. If Chrome switches to that we have broader consensus and can see about updating the HTML spec to agree. What do you think?
Project Member

Comment 7 by sheriffbot@chromium.org, Nov 6 2017

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available. If you change it back, also remove the "Hotlist-Recharge-Cold" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
FYI, original repro steps bitrotted. Here's the updated URI using the moved postman-echo service:

data:text/html;charset=utf-8,<form accept-charset="windows-1252" method=POST enctype="multipart/form-data" action="https://postman-echo.com/post"><ol><li><a download="U&%23xE2;&%23x98;&%23xBA;%E2%98%BA.U&%23xE2;&%23x98;&%23xBA;%E2%98%BA" href="data:application/octet-stream,U%C3%A2%C2%98%C2%BA%E2%98%BA">download</a><li><input type=file name="q"><li><input type=submit value=upload></ol></form>
Cc: -bsittler@chromium.org
Owner: bsittler@chromium.org
Status: Started (was: Untriaged)
I have filed https://github.com/w3c/html/issues/1077 requesting that this behavior be standardized in HTML
Project Member

Comment 12 by bugdroid1@chromium.org, Nov 17 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/db09e1f2c1dc2b6962d55184e96f16ac62998376

commit db09e1f2c1dc2b6962d55184e96f16ac62998376
Author: Benjamin C. Wiley Sittler <bsittler@chromium.org>
Date: Fri Nov 17 03:37:32 2017

Forms: Use numeric character references for unencodable characters in upload filenames.

Blink-dev intent to implement and ship discussion:
https://groups.google.com/a/chromium.org/d/msg/blink-dev/T11QWD2Jyyo/3oS5gCxYAQAJ

Chrome Platform Status entry:
https://www.chromestatus.com/features/5634575908732928

https://github.com/whatwg/html/issues/3223 filed against the
HTML specification requests that this behavior be standardized.

The newly-added layout tests should work fine on Windows with
"ANSI" codepage 1252 or with a recent Win32.pm installed, and
under UTF-8 locales on Linux, OS X, and similar operating systems.

Behavior after this change:

A user uploading two files, 'MyEmoji😂.svg' and 'MyEmoji☺.svg' in a
multiple file upload to an ASCII form will discover the server sees
them as two files with distinct names, 'MyEmoji&#128514;.svg' and
'MyEmoji&#9786;.svg'.

Behavior before this change:

A user uploading two files, 'MyEmoji😂.svg' and 'MyEmoji☺.svg' in a
multiple file upload to an ASCII form will discover the server sees
them only as two files both named 'MyEmoji?.svg'.

Bug:  661819 
Change-Id: I8795584d9c5e23c0bcb4c85dc546766d202ad2a3
Reviewed-on: https://chromium-review.googlesource.com/755342
Commit-Queue: Benjamin Wiley Sittler <bsittler@chromium.org>
Reviewed-by: Joshua Bell <jsbell@chromium.org>
Reviewed-by: Victor Costan <pwnall@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#517280}
[add] https://crrev.com/db09e1f2c1dc2b6962d55184e96f16ac62998376/third_party/WebKit/LayoutTests/http/tests/local/fileapi/resources/delete-temp-file.cgi
[add] https://crrev.com/db09e1f2c1dc2b6962d55184e96f16ac62998376/third_party/WebKit/LayoutTests/http/tests/local/fileapi/resources/send-dragged-file-form-helper.js
[add] https://crrev.com/db09e1f2c1dc2b6962d55184e96f16ac62998376/third_party/WebKit/LayoutTests/http/tests/local/fileapi/resources/write-temp-file.cgi
[add] https://crrev.com/db09e1f2c1dc2b6962d55184e96f16ac62998376/third_party/WebKit/LayoutTests/http/tests/local/fileapi/send-dragged-file-form-iso-2022-jp.html
[add] https://crrev.com/db09e1f2c1dc2b6962d55184e96f16ac62998376/third_party/WebKit/LayoutTests/http/tests/local/fileapi/send-dragged-file-form-utf-8.html
[add] https://crrev.com/db09e1f2c1dc2b6962d55184e96f16ac62998376/third_party/WebKit/LayoutTests/http/tests/local/fileapi/send-dragged-file-form-windows-1252.html
[add] https://crrev.com/db09e1f2c1dc2b6962d55184e96f16ac62998376/third_party/WebKit/LayoutTests/http/tests/local/fileapi/send-dragged-file-form-x-user-defined.html
[add] https://crrev.com/db09e1f2c1dc2b6962d55184e96f16ac62998376/third_party/WebKit/LayoutTests/http/tests/local/fileapi/send-dragged-file-form.html
[modify] https://crrev.com/db09e1f2c1dc2b6962d55184e96f16ac62998376/third_party/WebKit/Source/platform/network/FormDataEncoder.cpp

Project Member

Comment 13 by bugdroid1@chromium.org, Nov 18 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/126a0e6e97f36b67ddcc38569e946c5621aeb643

commit 126a0e6e97f36b67ddcc38569e946c5621aeb643
Author: Benjamin C. Wiley Sittler <bsittler@chromium.org>
Date: Sat Nov 18 03:38:46 2017

Forms: use http: rather than file: to accomodate OOPIF

Bug:  786539 
Bug:  661819 
Change-Id: I26167fe8cf6f5959420d15fbed9e49a118f445b7
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_site_isolation
Reviewed-on: https://chromium-review.googlesource.com/778019
Commit-Queue: Benjamin Wiley Sittler <bsittler@chromium.org>
Reviewed-by: Victor Costan <pwnall@chromium.org>
Reviewed-by: Marijn Kruisselbrink <mek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#517694}
[modify] https://crrev.com/126a0e6e97f36b67ddcc38569e946c5621aeb643/third_party/WebKit/LayoutTests/FlagExpectations/site-per-process
[rename] https://crrev.com/126a0e6e97f36b67ddcc38569e946c5621aeb643/third_party/WebKit/LayoutTests/http/tests/fileapi/resources/delete-temp-file.cgi
[rename] https://crrev.com/126a0e6e97f36b67ddcc38569e946c5621aeb643/third_party/WebKit/LayoutTests/http/tests/fileapi/resources/send-dragged-file-form-helper.js
[rename] https://crrev.com/126a0e6e97f36b67ddcc38569e946c5621aeb643/third_party/WebKit/LayoutTests/http/tests/fileapi/resources/write-temp-file.cgi
[rename] https://crrev.com/126a0e6e97f36b67ddcc38569e946c5621aeb643/third_party/WebKit/LayoutTests/http/tests/fileapi/send-dragged-file-form-iso-2022-jp.html
[rename] https://crrev.com/126a0e6e97f36b67ddcc38569e946c5621aeb643/third_party/WebKit/LayoutTests/http/tests/fileapi/send-dragged-file-form-utf-8.html
[rename] https://crrev.com/126a0e6e97f36b67ddcc38569e946c5621aeb643/third_party/WebKit/LayoutTests/http/tests/fileapi/send-dragged-file-form-windows-1252.html
[rename] https://crrev.com/126a0e6e97f36b67ddcc38569e946c5621aeb643/third_party/WebKit/LayoutTests/http/tests/fileapi/send-dragged-file-form-x-user-defined.html
[rename] https://crrev.com/126a0e6e97f36b67ddcc38569e946c5621aeb643/third_party/WebKit/LayoutTests/http/tests/fileapi/send-dragged-file-form.html

Project Member

Comment 14 by bugdroid1@chromium.org, Nov 20 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/78383443fce02079cbbec26f911abea2ca70dc5b

commit 78383443fce02079cbbec26f911abea2ca70dc5b
Author: Benjamin C. Wiley Sittler <bsittler@chromium.org>
Date: Mon Nov 20 23:51:42 2017

Forms: bifurcate file upload tests to escape from occasional timeouts.

These tests sometimes timed out due to really slow CGI execution on Windows.

See e.g. https://chromium-review.googlesource.com/c/chromium/src/+/766954/10..14

https://build.chromium.org/p/tryserver.chromium.win/builders/win7_chromium_rel_ng/builds/48028
https://build.chromium.org/p/tryserver.chromium.win/builders/win7_chromium_rel_ng/builds/48141
but passing on rerun
http://build.chromium.org/p/tryserver.chromium.win/builders/win7_chromium_rel_ng/builds/48285

Bug:  661819 
Change-Id: Ic81b193eabf8a65b5d933a1309113473d9e353f0
Reviewed-on: https://chromium-review.googlesource.com/780539
Reviewed-by: Joshua Bell <jsbell@chromium.org>
Commit-Queue: Benjamin Wiley Sittler <bsittler@chromium.org>
Cr-Commit-Position: refs/heads/master@{#518000}
[rename] https://crrev.com/78383443fce02079cbbec26f911abea2ca70dc5b/third_party/WebKit/LayoutTests/http/tests/fileapi/send-dragged-file-form-iso-2022-jp-part1.html
[copy] https://crrev.com/78383443fce02079cbbec26f911abea2ca70dc5b/third_party/WebKit/LayoutTests/http/tests/fileapi/send-dragged-file-form-iso-2022-jp-part2.html
[rename] https://crrev.com/78383443fce02079cbbec26f911abea2ca70dc5b/third_party/WebKit/LayoutTests/http/tests/fileapi/send-dragged-file-form-utf-8-part1.html
[copy] https://crrev.com/78383443fce02079cbbec26f911abea2ca70dc5b/third_party/WebKit/LayoutTests/http/tests/fileapi/send-dragged-file-form-utf-8-part2.html
[copy] https://crrev.com/78383443fce02079cbbec26f911abea2ca70dc5b/third_party/WebKit/LayoutTests/http/tests/fileapi/send-dragged-file-form-windows-1252-part1.html
[rename] https://crrev.com/78383443fce02079cbbec26f911abea2ca70dc5b/third_party/WebKit/LayoutTests/http/tests/fileapi/send-dragged-file-form-windows-1252-part2.html
[rename] https://crrev.com/78383443fce02079cbbec26f911abea2ca70dc5b/third_party/WebKit/LayoutTests/http/tests/fileapi/send-dragged-file-form-x-user-defined-part1.html
[copy] https://crrev.com/78383443fce02079cbbec26f911abea2ca70dc5b/third_party/WebKit/LayoutTests/http/tests/fileapi/send-dragged-file-form-x-user-defined-part2.html

Project Member

Comment 15 by bugdroid1@chromium.org, Nov 21 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6ec8ee4de81c1a053c4cc82b03123969f6567a68

commit 6ec8ee4de81c1a053c4cc82b03123969f6567a68
Author: Benjamin C. Wiley Sittler <bsittler@chromium.org>
Date: Tue Nov 21 17:53:28 2017

WTF: Remove kQuestionMarksForUnencodables as its final real user is gone.

Bug:  661819 
Change-Id: Id393c7dca3652884287d328c9aa76a4044b00f85
Reviewed-on: https://chromium-review.googlesource.com/780580
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Reviewed-by: Joshua Bell <jsbell@chromium.org>
Commit-Queue: Benjamin Wiley Sittler <bsittler@chromium.org>
Cr-Commit-Position: refs/heads/master@{#518303}
[modify] https://crrev.com/6ec8ee4de81c1a053c4cc82b03123969f6567a68/third_party/WebKit/Source/modules/encoding/TextEncoder.cpp
[modify] https://crrev.com/6ec8ee4de81c1a053c4cc82b03123969f6567a68/third_party/WebKit/Source/platform/TextCodecFuzzer.cpp
[modify] https://crrev.com/6ec8ee4de81c1a053c4cc82b03123969f6567a68/third_party/WebKit/Source/platform/wtf/BUILD.gn
[modify] https://crrev.com/6ec8ee4de81c1a053c4cc82b03123969f6567a68/third_party/WebKit/Source/platform/wtf/text/TextCodec.cpp
[modify] https://crrev.com/6ec8ee4de81c1a053c4cc82b03123969f6567a68/third_party/WebKit/Source/platform/wtf/text/TextCodec.h
[modify] https://crrev.com/6ec8ee4de81c1a053c4cc82b03123969f6567a68/third_party/WebKit/Source/platform/wtf/text/TextCodecICU.cpp
[modify] https://crrev.com/6ec8ee4de81c1a053c4cc82b03123969f6567a68/third_party/WebKit/Source/platform/wtf/text/TextCodecLatin1.cpp
[delete] https://crrev.com/77884cd34c0de5de1e2fc57b71e09c7133508a5c/third_party/WebKit/Source/platform/wtf/text/TextCodecLatin1Test.cpp
[modify] https://crrev.com/6ec8ee4de81c1a053c4cc82b03123969f6567a68/third_party/WebKit/Source/platform/wtf/text/TextCodecReplacementTest.cpp
[modify] https://crrev.com/6ec8ee4de81c1a053c4cc82b03123969f6567a68/third_party/WebKit/Source/platform/wtf/text/TextCodecTest.cpp
[modify] https://crrev.com/6ec8ee4de81c1a053c4cc82b03123969f6567a68/third_party/WebKit/Source/platform/wtf/text/TextCodecUserDefined.cpp
[delete] https://crrev.com/77884cd34c0de5de1e2fc57b71e09c7133508a5c/third_party/WebKit/Source/platform/wtf/text/TextCodecUserDefinedTest.cpp

Status: Fixed (was: Started)
It would probably also be a good idea to test precomposed and decomposed combining sequences and similar cases of canonical and de-facto equivalence, as this is an area where real-life data loss is more or less to be expected if an implementation is insufficiently lenient.

For example, 

- "Chữ Nôm" and "Chữ Nôm" may be treated interchangeably or canonicalized by some filesystem layers
- two or more of "한글", "한글", "ㅎㅏㄴㄱㅡㄹ", and "하ᄂ그ᄅ" may be treated interchangeably or canonicalized by some filesystem layers
- བྷྲཱྀནྟྲཱནཱེནྡྷི may end up being de-facto equivalent to  on a system using a Chinese locale and implementing the proposed Private Use Area mapping for Extended Tibetan Set A (these are at least visually identical on the Chromebook I'm using right now)
One more example:
- '' may end up being de-facto equivalent to 'ཧྭོ' on some systems but on others it's not, and is visually more like '🍎︎' with a bite taken out of it
Project Member

Comment 19 by bugdroid1@chromium.org, Dec 6 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/23a4547bb9f3a34e49183b7b0608f63cff624863

commit 23a4547bb9f3a34e49183b7b0608f63cff624863
Author: Benjamin C. Wiley Sittler <bsittler@chromium.org>
Date: Wed Dec 06 02:07:14 2017

Forms: Use checked-in files rather than CGIs in LayoutTests

The CGIs were previously the only way to test Unicode filenames in
file uploads, but introduced noticeable test slowdowns, especially
on Win32.

This also removes the test bifurcation previously added to avoid
occasional Win32 timeouts due to Win32 CGI slowness:
https://chromium.googlesource.com/chromium/src/+/78383443fce02079cbbec26f911abea2ca70dc5b

TBR=

Bug:  661819 
Change-Id: Iab3295f665bdfe4c51688f4fa42162505f36a929
Reviewed-on: https://chromium-review.googlesource.com/802554
Commit-Queue: Marc-Antoine Ruel <maruel@chromium.org>
Reviewed-by: Victor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521947}
[delete] https://crrev.com/f85ab8f6698eec5987f95c9ea6ff95266c566b17/third_party/WebKit/LayoutTests/http/tests/fileapi/resources/delete-temp-file.cgi
[delete] https://crrev.com/f85ab8f6698eec5987f95c9ea6ff95266c566b17/third_party/WebKit/LayoutTests/http/tests/fileapi/resources/write-temp-file.cgi
[delete] https://crrev.com/f85ab8f6698eec5987f95c9ea6ff95266c566b17/third_party/WebKit/LayoutTests/http/tests/fileapi/send-dragged-file-form-iso-2022-jp-part2.html
[delete] https://crrev.com/f85ab8f6698eec5987f95c9ea6ff95266c566b17/third_party/WebKit/LayoutTests/http/tests/fileapi/send-dragged-file-form-utf-8-part2.html
[delete] https://crrev.com/f85ab8f6698eec5987f95c9ea6ff95266c566b17/third_party/WebKit/LayoutTests/http/tests/fileapi/send-dragged-file-form-windows-1252-part1.html
[delete] https://crrev.com/f85ab8f6698eec5987f95c9ea6ff95266c566b17/third_party/WebKit/LayoutTests/http/tests/fileapi/send-dragged-file-form-x-user-defined-part2.html
[add] https://crrev.com/23a4547bb9f3a34e49183b7b0608f63cff624863/third_party/WebKit/LayoutTests/http/tests/local/fileapi/resources/file-for-drag-to-send3-ABC~‾¥≈¤・・•∙·☼★星🌟星★☼·∙•・・¤≈¥‾~XYZ.txt
[add] https://crrev.com/23a4547bb9f3a34e49183b7b0608f63cff624863/third_party/WebKit/LayoutTests/http/tests/local/fileapi/resources/file-for-drag-to-send3-☺😂.txt
[add] https://crrev.com/23a4547bb9f3a34e49183b7b0608f63cff624863/third_party/WebKit/LayoutTests/http/tests/local/fileapi/resources/file-for-drag-to-send3-★星★.txt
[add] https://crrev.com/23a4547bb9f3a34e49183b7b0608f63cff624863/third_party/WebKit/LayoutTests/http/tests/local/fileapi/resources/file-for-drag-to-send3-☺😂.txt
[add] https://crrev.com/23a4547bb9f3a34e49183b7b0608f63cff624863/third_party/WebKit/LayoutTests/http/tests/local/fileapi/resources/file-for-drag-to-send3-.txt
[add] https://crrev.com/23a4547bb9f3a34e49183b7b0608f63cff624863/third_party/WebKit/LayoutTests/http/tests/local/fileapi/resources/file-for-drag-to-send3.txt
[rename] https://crrev.com/23a4547bb9f3a34e49183b7b0608f63cff624863/third_party/WebKit/LayoutTests/http/tests/local/fileapi/resources/send-dragged-file-form-helper.js
[rename] https://crrev.com/23a4547bb9f3a34e49183b7b0608f63cff624863/third_party/WebKit/LayoutTests/http/tests/local/fileapi/send-dragged-file-form-iso-2022-jp.html
[rename] https://crrev.com/23a4547bb9f3a34e49183b7b0608f63cff624863/third_party/WebKit/LayoutTests/http/tests/local/fileapi/send-dragged-file-form-utf-8.html
[rename] https://crrev.com/23a4547bb9f3a34e49183b7b0608f63cff624863/third_party/WebKit/LayoutTests/http/tests/local/fileapi/send-dragged-file-form-windows-1252.html
[rename] https://crrev.com/23a4547bb9f3a34e49183b7b0608f63cff624863/third_party/WebKit/LayoutTests/http/tests/local/fileapi/send-dragged-file-form-x-user-defined.html
[rename] https://crrev.com/23a4547bb9f3a34e49183b7b0608f63cff624863/third_party/WebKit/LayoutTests/http/tests/local/fileapi/send-dragged-file-form.html

Project Member

Comment 20 by bugdroid1@chromium.org, Dec 6 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/36fe3be5307e91c7cefa3491835d890c3424613a

commit 36fe3be5307e91c7cefa3491835d890c3424613a
Author: Benjamin C. Wiley Sittler <bsittler@chromium.org>
Date: Wed Dec 06 17:19:10 2017

Forms: Remove CGIs and eventSender from multipart form-based file upload tests

Use mutable DataTransferItemList instead of eventSender, drag-n-drop,
CGIs, or Unicode files on the host filesystem to exercise multipart
form file upload filename encoding.

Add separate non-upload tests for dragging Unicode-named files from
the host filesystem onto <input type=file>.

This also stops relying on script-triggered onchange for input type=file, it
may be a bug - see  crbug.com/792336  for discussion.

Finally, this re-fixes the out-of-process IFRAME breakage reintroduced in
https://crrev.com/521947

Technique from:

https://github.com/whatwg/html/issues/2861#issuecomment-348888148

Bug:  661819 
Bug:  786539 
Change-Id: I7d6c9d03770759d1552a4456d869eb544cb652a0
Reviewed-on: https://chromium-review.googlesource.com/807465
Reviewed-by: Emil A Eklund <eae@chromium.org>
Reviewed-by: Victor Costan <pwnall@chromium.org>
Commit-Queue: Benjamin Wiley Sittler <bsittler@chromium.org>
Cr-Commit-Position: refs/heads/master@{#522122}
[rename] https://crrev.com/36fe3be5307e91c7cefa3491835d890c3424613a/third_party/WebKit/LayoutTests/http/tests/fileapi/resources/send-file-form-helper.js
[add] https://crrev.com/36fe3be5307e91c7cefa3491835d890c3424613a/third_party/WebKit/LayoutTests/http/tests/fileapi/send-file-form-iso-2022-jp.html
[add] https://crrev.com/36fe3be5307e91c7cefa3491835d890c3424613a/third_party/WebKit/LayoutTests/http/tests/fileapi/send-file-form-utf-8.html
[add] https://crrev.com/36fe3be5307e91c7cefa3491835d890c3424613a/third_party/WebKit/LayoutTests/http/tests/fileapi/send-file-form-windows-1252.html
[add] https://crrev.com/36fe3be5307e91c7cefa3491835d890c3424613a/third_party/WebKit/LayoutTests/http/tests/fileapi/send-file-form-x-user-defined.html
[add] https://crrev.com/36fe3be5307e91c7cefa3491835d890c3424613a/third_party/WebKit/LayoutTests/http/tests/fileapi/send-file-form.html
[add] https://crrev.com/36fe3be5307e91c7cefa3491835d890c3424613a/third_party/WebKit/LayoutTests/http/tests/local/fileapi/resources/select-dragged-file-input-helper.js
[rename] https://crrev.com/36fe3be5307e91c7cefa3491835d890c3424613a/third_party/WebKit/LayoutTests/http/tests/local/fileapi/select-dragged-file-input-utf-8.html
[add] https://crrev.com/36fe3be5307e91c7cefa3491835d890c3424613a/third_party/WebKit/LayoutTests/http/tests/local/fileapi/select-dragged-file-input.html
[delete] https://crrev.com/811333893d25ec4c391e6dd968e4960c08251d4c/third_party/WebKit/LayoutTests/http/tests/local/fileapi/send-dragged-file-form-iso-2022-jp.html
[delete] https://crrev.com/811333893d25ec4c391e6dd968e4960c08251d4c/third_party/WebKit/LayoutTests/http/tests/local/fileapi/send-dragged-file-form-windows-1252.html
[delete] https://crrev.com/811333893d25ec4c391e6dd968e4960c08251d4c/third_party/WebKit/LayoutTests/http/tests/local/fileapi/send-dragged-file-form-x-user-defined.html
[delete] https://crrev.com/811333893d25ec4c391e6dd968e4960c08251d4c/third_party/WebKit/LayoutTests/http/tests/local/fileapi/send-dragged-file-form.html

Project Member

Comment 21 by bugdroid1@chromium.org, Dec 6 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2e6a737d17833044001030642d49800f2ebd74dd

commit 2e6a737d17833044001030642d49800f2ebd74dd
Author: Benjamin C. Wiley Sittler <bsittler@chromium.org>
Date: Wed Dec 06 21:29:35 2017

WPT: Add form-based file upload coverage

Tests multipart form POSTs with file inputs where the selected "file"
was constructed using the `File` constructor and added to a
`DataTransferItemList` (this avoids the user gesture requirement which
otherwise would consign this to manual testing.) For the non-ASCII
filenames with non-UTF-8 accept-charsets this also verifies fallback
encoding/replacement of unrepresentable characters using numeric
character references. https://github.com/whatwg/html/issues/2861

Coverage for fallback encoding is still tentative because filename
fallback encoding is not yet standardized.
https://github.com/whatwg/html/issues/3223

Bug:  661819 
Change-Id: Ic646f76b0c8a0792d1214a7848d2238bcc3a76e7
Reviewed-on: https://chromium-review.googlesource.com/811625
Reviewed-by: Victor Costan <pwnall@chromium.org>
Reviewed-by: Joshua Bell <jsbell@chromium.org>
Commit-Queue: Benjamin Wiley Sittler <bsittler@chromium.org>
Cr-Commit-Position: refs/heads/master@{#522197}
[rename] https://crrev.com/2e6a737d17833044001030642d49800f2ebd74dd/third_party/WebKit/LayoutTests/external/wpt/FileAPI/file/send-file-form-iso-2022-jp.tentative.html
[rename] https://crrev.com/2e6a737d17833044001030642d49800f2ebd74dd/third_party/WebKit/LayoutTests/external/wpt/FileAPI/file/send-file-form-utf-8.html
[rename] https://crrev.com/2e6a737d17833044001030642d49800f2ebd74dd/third_party/WebKit/LayoutTests/external/wpt/FileAPI/file/send-file-form-windows-1252.tentative.html
[rename] https://crrev.com/2e6a737d17833044001030642d49800f2ebd74dd/third_party/WebKit/LayoutTests/external/wpt/FileAPI/file/send-file-form-x-user-defined.tentative.html
[rename] https://crrev.com/2e6a737d17833044001030642d49800f2ebd74dd/third_party/WebKit/LayoutTests/external/wpt/FileAPI/file/send-file-form.html
[rename] https://crrev.com/2e6a737d17833044001030642d49800f2ebd74dd/third_party/WebKit/LayoutTests/external/wpt/FileAPI/support/send-file-form-helper.js

Comment 22 Deleted

Much simpler repro instructions:

data:text/html;charset=utf-8,<script>onload=()=>{const dt=new DataTransfer;dt.items.add(new File(['U\xE2\u02DC\xBA☺.U\xE2\u02DC\xBA☺'],'U\xE2\u02DC\xBA☺.U\xE2\u02DC\xBA☺'));const f=document.forms[0];f.elements[0].files=dt.files;f.submit()}</script><form accept-charset="windows-1252" method=POST enctype="multipart/form-data" action="https://postman-echo.com/post"><input type=file name="q"></form>

a.k.a.

data:text/html;charset=utf-8,%3Cscript%3Eonload%3D()%3D%3E%7Bconst%20dt%3Dnew%20DataTransfer%3Bdt.items.add(new%20File(%5B'U%5CxE2%5Cu02DC%5CxBA%E2%98%BA.U%5CxE2%5Cu02DC%5CxBA%E2%98%BA'%5D%2C'U%5CxE2%5Cu02DC%5CxBA%E2%98%BA.U%5CxE2%5Cu02DC%5CxBA%E2%98%BA'))%3Bconst%20f%3Ddocument.forms%5B0%5D%3Bf.elements%5B0%5D.files%3Ddt.files%3Bf.submit()%7D%3C%2Fscript%3E%3Cform%20accept-charset%3D%22windows-1252%22%20method%3DPOST%20enctype%3D%22multipart%2Fform-data%22%20action%3D%22https%3A%2F%2Fpostman-echo.com%2Fpost%22%3E%3Cinput%20type%3Dfile%20name%3D%22q%22%3E%3C%2Fform%3E
Description: Show this description
Description: Show this description
#17, Please refer to Issue 674022 for filename NFC/NFD.

Sign in to add a comment