Changeset 285808 in webkit
- Timestamp:
- Nov 15, 2021 9:32:18 AM (8 months ago)
- Location:
- trunk
- Files:
-
- 4 edited
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/form-submission-0/form-data-set-empty-file.window-expected.txt (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/html/FileInputType.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r285803 r285808 1 2021-11-15 Andreu Botella <andreu@andreubotella.com> 2 3 Empty <input type=file> controls don't show up in the urlencoded and text/plain enctypes 4 https://bugs.webkit.org/show_bug.cgi?id=221549 5 6 Reviewed by Chris Dumez. 7 8 * web-platform-tests/html/semantics/forms/form-submission-0/form-data-set-empty-file.window-expected.txt: 9 1 10 2021-11-15 Cathie Chen <cathiechen@igalia.com> 2 11 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/form-submission-0/form-data-set-empty-file.window-expected.txt
r279427 r285808 1 1 2 2 FAIL Empty <input type=file> is still added to the form's entry list assert_equals: type expected "application/octet-stream" but got "" 3 FAIL Empty <input type=file> shows up in the urlencoded serialization assert_equals: expected "hi=" but got "" 3 PASS Empty <input type=file> shows up in the urlencoded serialization 4 4 PASS Empty <input type=file> shows up in the multipart/form-data serialization 5 FAIL Empty <input type=file> shows up in the text/plain serialization assert_equals: expected "hi=\n" but got " "5 FAIL Empty <input type=file> shows up in the text/plain serialization assert_equals: expected "hi=\n" but got "hi=" 6 6 -
trunk/Source/WebCore/ChangeLog
r285807 r285808 1 2021-11-15 Andreu Botella <andreu@andreubotella.com> 2 3 Empty <input type=file> controls don't show up in the urlencoded and text/plain enctypes 4 https://bugs.webkit.org/show_bug.cgi?id=221549 5 6 Reviewed by Chris Dumez. 7 8 In the HTML spec, and in Firefox and Chrome's implementations, an empty <input type="file"> 9 control is represented in form submission as if it were an empty file with an empty 10 filename. WebKit, however, does not include a form entry corresponding to the file input at 11 all in the application/x-www-form-urlencoded and text/plain enctypes. This change fixes it. 12 13 Tests: imported/w3c/web-platform-tests/html/semantics/forms/form-submission-0/form-data-set-empty-file.window.html 14 15 * html/FileInputType.cpp: 16 (WebCore::FileInputType::appendFormData const): 17 1 18 2021-11-15 Antti Koivisto <antti@apple.com> 2 19 -
trunk/Source/WebCore/html/FileInputType.cpp
r284009 r285808 171 171 // 4.10.16.4 and 4.10.16.6 sections in HTML5. 172 172 173 // Unlike the multipart case, we have no special handling for the empty 174 // fileList because Netscape doesn't support for non-multipart 175 // submission of file inputs, and Firefox doesn't add "name=" query 176 // parameter. 173 if (fileList->isEmpty()) 174 formData.append(name, ""); 175 177 176 for (auto& file : fileList->files()) 178 177 formData.append(name, file->name());
Note: See TracChangeset
for help on using the changeset viewer.