Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Intent to implement and ship extended FormData methods

58 views
Skip to first unread message

nsm.n...@gmail.com

unread,
Jan 29, 2015, 4:57:00 PM1/29/15
to
Summary: FormData[1] has been an append only interface since it was introduced. The WHATWG version of the XHR spec added several methods to has/get/set/delete on the entries and introduced iteration support. This puts it in the same class as URLSearchParams and Headers.

The proposed patch does not add iterator support.

This email is about 24 hours late in that I've already implemented the changes yesterday.

Blink already implements this but hides it behind a flag - https://groups.google.com/a/chromium.org/forum/#!msg/blink-dev/ksXEB6uB7RY/ZwtCdZGyIVgJ. It is the only known engine shipping the feature.

Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1085283

Link to standard:
https://xhr.spec.whatwg.org/#interface-formdata
Old standard [1] - http://www.w3.org/TR/XMLHttpRequest/#interface-formdata

Platform coverage: All platforms.
Estimated or target release: Firefox 38

Preference behind which this will be implemented: Should this be preffed off by default? It seems a very additive feature to me. In addition the similar URLSearchParams has been around for a while as has Headers, so the operation patterns seem to be well established. Happy to put it behind "dom.formdata.advanced" though.

Nikhil

Boris Zbarsky

unread,
Jan 29, 2015, 9:39:22 PM1/29/15
to
On 1/29/15 4:56 PM, nsm.n...@gmail.com wrote:
> The proposed patch does not add iterator support.

Is there a bug tracking adding this?

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

I assume something defines what happens if you delete() while sending
the formdata and that we implement whatever that is and have test
coverage for such things?

Apart from those two concerns, this looks fine to me.

-Boris

nsm.n...@gmail.com

unread,
Jan 30, 2015, 1:25:49 AM1/30/15
to
On Thursday, January 29, 2015 at 6:39:22 PM UTC-8, Boris Zbarsky wrote:
> On 1/29/15 4:56 PM, nsm.n...@gmail.com wrote:
> > The proposed patch does not add iterator support.
>
> Is there a bug tracking adding this?

https://bugzilla.mozilla.org/show_bug.cgi?id=1127703

>
> > https://xhr.spec.whatwg.org/#interface-formdata
>
> I assume something defines what happens if you delete() while sending
> the formdata and that we implement whatever that is and have test
> coverage for such things?

The fetch spec states that FormData is immediately serialized when send() is called (send defers to Fetch's "extract body" routine) https://fetch.spec.whatwg.org/#concept-bodyinit-extract.

In Gecko, an nsFSMultipartFormData object serializes all entries to a multiplex stream immediately, so delete()/set()s called after a call to send() won't change the entries.

Boris Zbarsky

unread,
Jan 30, 2015, 10:12:11 AM1/30/15
to
On 1/30/15 1:25 AM, nsm.n...@gmail.com wrote:
> https://bugzilla.mozilla.org/show_bug.cgi?id=1127703

Thanks.

> The fetch spec states that FormData is immediately serialized when send() is called (send defers to Fetch's "extract body" routine) https://fetch.spec.whatwg.org/#concept-bodyinit-extract.
>
> In Gecko, an nsFSMultipartFormData object serializes all entries to a multiplex stream immediately, so delete()/set()s called after a call to send() won't change the entries.

Excellent!

-Boris

nsm.n...@gmail.com

unread,
Feb 26, 2015, 3:31:17 PM2/26/15
to
This will ship in 39.
0 new messages