Intent to Ship: Add optional submitter parameter to FormData constructor

173 views
Skip to first unread message

Jon Jensen

unread,
Jan 30, 2023, 10:50:49 AM1/30/23
to blin...@chromium.org

Contact emails

jo...@netflix.com

Explainer

None

Specification

https://xhr.spec.whatwg.org/#interface-formdata

Summary

Allow passing a submit button to the FormData constructor. If the button has a name or is an image button, it will contribute to the form data set. This makes it possible to create a FormData object with the same data set as a vanilla form submission triggered by the button.



Blink component

Blink>Forms

TAG review



TAG review status

Not applicable

Risks



Interoperability and Compatibility



Gecko: In development (https://phabricator.services.mozilla.com/D167576)

WebKit: In development (https://github.com/WebKit/WebKit/pull/9188) Approved for release, barring any regressions

Web developers: Positive (https://github.com/remix-run/remix/issues/4342#issuecomment-1297535216)

Other signals:

Ergonomics

N/A



Activation

If developers need to support this feature in older browsers, they can polyfill it fairly easily (e.g. https://github.com/jenseng/formdata-submitter-polyfill), or they can employ simpler (though less robust) workarounds like so: const formData = new FormData(form, submitter); if (!formData.has(submitter.name)) formData.append(submitter.name, submitter.value);



Security

N/A, leveraging existing form entry list construction and constraints.



WebView application risks

Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?

No



Debuggability

N/A, simple WebIDL change that works as expected.



Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?

Yes

FormData is a core feature of all platforms



Is this feature fully tested by web-platform-tests?

Yes

Flag name



Requires code in //chrome?

False

Non-OSS dependencies

Does the feature depend on any code or APIs outside the Chromium open source repository and its open-source dependencies to function?

No

Estimated milestones

No milestones specified



Anticipated spec changes

Open questions about a feature may be a source of future web compat or interop issues. Please list open issues (e.g. links to known github issues in the project for the feature specification) whose resolution may introduce web compat/interop risk (e.g., changing to naming or structure of the API in a non-backward-compatible way).



Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/5066604734316544

Links to previous Intent discussions

Intent to prototype: https://github.com/whatwg/xhr/pull/366


This intent message was generated by Chrome Platform Status.

Jon Jensen

unread,
Jan 30, 2023, 12:03:00 PM1/30/23
to blink-dev, Jon Jensen
Quick update, the WebKit PR has now been merged

Mike Taylor

unread,
Jan 30, 2023, 12:06:05 PM1/30/23
to Jon Jensen, blink-dev
LGTM1 - this is a simple, useful addition.

(Also kudos for writing patches in 3 engines, Jon)
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/95274072-fc12-440f-959f-d58203a3e93fn%40chromium.org.


Alex Russell

unread,
Jan 30, 2023, 2:10:30 PM1/30/23
to Mike Taylor, Jon Jensen, blink-dev
LGTM2 with the nit that this should be sent to the TAG as an FYI. We don't need their review on everything, but we do need them to see everything we see so that they can help guide folks in a consistent way in future.

Best,

Alex

Alex Russell

unread,
Jan 30, 2023, 2:20:46 PM1/30/23
to Jon Jensen, blink-dev, mike...@chromium.org
Just file it as an issue in their GH and mention that it's an FYI:

https://github.com/w3ctag/design-reviews/issues

On Mon, Jan 30, 2023 at 11:18 AM Jon Jensen <jo...@netflix.com> wrote:
Thanks Mike and Alex! What's the best way to send an FYI to TAG? Post something to https://lists.w3.org/Archives/Public/www-tag/, or is there a more formal mechanism?

Jon

Jon Jensen

unread,
Jan 30, 2023, 3:20:25 PM1/30/23
to blink-dev, sligh...@chromium.org, Jon Jensen, blink-dev, mike...@chromium.org
Thanks Mike and Alex! What's the best way to send an FYI to TAG? Post something to https://lists.w3.org/Archives/Public/www-tag/, or is there a more formal mechanism?

Jon

On Monday, January 30, 2023 at 12:10:30 PM UTC-7 sligh...@chromium.org wrote:

Jon Jensen

unread,
Jan 30, 2023, 4:27:18 PM1/30/23
to blink-dev, Jon Jensen, sligh...@chromium.org, blink-dev, mike...@chromium.org

Yoav Weiss

unread,
Feb 1, 2023, 5:46:09 AM2/1/23
to blink-dev, jo...@netflix.com, Alex Russell, blink-dev, Mike Taylor
LGTM3

Glad to see you're pushing the platform towards where you need it to be. More of that please!! :D

Jon Jensen

unread,
Feb 2, 2023, 12:52:53 PM2/2/23
to blink-dev, yoav...@chromium.org, Jon Jensen, sligh...@chromium.org, blink-dev, mike...@chromium.org
Thanks everyone! Just a heads up for future TAG reviews/FYIs, on the thread Lea said: "Just as a matter of process : we don’t really do FYIs. Either there’s something for us to review and feed back on or there isn’t."

Thanks,
Jon

Reply all
Reply to author
Forward
0 new messages