W3C home > Mailing lists > Public > public-script-coord@w3.org > July to September 2013

URLQuery / FormData

From: Anne van Kesteren <annevk@annevk.nl>
Date: Mon, 9 Sep 2013 12:30:06 +0100
Message-ID: <CADnb78hWROBu4+b1Nk1+xH5c2BMyGr4e3CfYk_zeFaDV-Fzf8g@mail.gmail.com>
To: "public-script-coord@w3.org" <public-script-coord@w3.org>
We had a discussion here once before I think about a good
representation for an ordered list of name/value pairs (i.e. allows
duplicate names). In particular this is what <form> represents and
therefore quite important.

http://url.spec.whatwg.org/#interface-urlquery has an API, but looking
over it now it's not really consistent in how get/set/delete works.

My current thinking is to update URLQuery as follows:

* get(name) -- always returns an array, with ES6 destructering this
should be fine
* append(name, value) -- always appends to the end
* delete(name) -- always removes all
* has(name) -- same as now

I'll leave out set() for now.

Since it's a list I don't think item count should be called size, but
rather length. However, maybe we don't need that for now either.

The object should also support iteration. Waiting for that to get
implemented in browsers and become more stable.


FormData can largely mirror this, but also needs to support Blob +
filename -> File so append supports an additional argument filename as
per http://xhr.spec.whatwg.org/#dom-formdata-append

Thoughts?


-- 
http://annevankesteren.nl/
Received on Monday, 9 September 2013 11:30:33 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:37:50 UTC