| Summary: | File inputs in non-multipart form submissions show up as string values in the formdata event | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Andreu Botella <andreu> | ||||||
| Component: | Forms | Assignee: | Nobody <webkit-unassigned> | ||||||
| Status: | RESOLVED FIXED | ||||||||
| Severity: | Normal | CC: | cdumez, changseok, clopez, esprehn+autocc, ews-watchlist, gyuyoung.kim, mifenton, webkit-bug-importer, wenson_hsieh, youennf | ||||||
| Priority: | P2 | Keywords: | InRadar | ||||||
| Version: | WebKit Nightly Build | ||||||||
| Hardware: | Unspecified | ||||||||
| OS: | Unspecified | ||||||||
| See Also: | https://github.com/web-platform-tests/wpt/pull/31821 | ||||||||
| Attachments: |
|
||||||||
|
Description
Andreu Botella
2021-12-01 14:13:55 PST
Created attachment 445620 [details]
Patch
This patch modifies the imported WPT tests. Please ensure that any changes on the tests (not coming from a WPT import) are exported to WPT. Please see https://trac.webkit.org/wiki/WPTExportProcess Comment on attachment 445620 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=445620&action=review > Source/WebCore/ChangeLog:10 > + filename. Before r280310, this optimizaton was unobservable, since the DOMFormData object typo: optimizaton > Source/WebCore/html/FileInputType.cpp:161 > +bool FileInputType::appendFormData(DOMFormData& formData, bool) const Can we drop the boolean parameter completely now or is it still required for some reason? > Source/WebCore/platform/network/FormData.cpp:277 > + if (std::holds_alternative<String>(item.data)) May be nice to use WTF::switchOn() here. Comment on attachment 445620 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=445620&action=review > LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/form-submission-0/constructing-form-data-set.html:80 > +for (const enctype of ["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"]) { Is this a resync from upstream? or is there a corresponding PR on upstream WPT? The change log doesn't say and we cannot make changes to WPT downstream unless these changes are also made upstream. Comment on attachment 445620 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=445620&action=review >> Source/WebCore/html/FileInputType.cpp:161 >> +bool FileInputType::appendFormData(DOMFormData& formData, bool) const > > Can we drop the boolean parameter completely now or is it still required for some reason? It's no longer required, but it involves changes in every subclass of InputType and FormAssociatedElement, as well as removing the third parameter to HTMLFormElement::constructEntryList, so it's probably best to leave for a follow-up patch. Comment on attachment 445620 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=445620&action=review >> LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/form-submission-0/constructing-form-data-set.html:80 >> +for (const enctype of ["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"]) { > > Is this a resync from upstream? or is there a corresponding PR on upstream WPT? > > The change log doesn't say and we cannot make changes to WPT downstream unless these changes are also made upstream. I opened https://github.com/web-platform-tests/wpt/pull/31821 upstream. Created attachment 445650 [details]
Patch
Comment on attachment 445650 [details]
Patch
r=me
Committed r286427 (244773@main): <https://commits.webkit.org/244773@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 445650 [details]. |