[whatwg] URL: URLQuery

Anne van Kesteren annevk at annevk.nl
Sat Oct 13 01:24:03 PDT 2012

On Sat, Oct 13, 2012 at 12:02 AM, Glenn Maynard <glenn at zewt.org> wrote:
> On Fri, Oct 12, 2012 at 11:10 AM, Anne van Kesteren <annevk at annevk.nl>
> wrote:
>> http://url.spec.whatwg.org/#urlutils
> The object paradigm is more natural for the common case:
> query.values["key"] = value; // get()
> console.log(query.values["key"]); // set()
> delete query.values["key"]; // delete()
> query.getAll("key"); // stays as-is

Where did .values come from? (And you reversed get()/set() right?)

>> Based on discussion in #whatwg
>> http://krijnhoetmer.nl/irc-logs/whatwg/20121012#l-981 I did not go
>> with a design that would require proxies when implemented in
>> JavaScript.
> The questions there (query parameter called "length", "interface and the
> data separate", "number of parameters") may have made sense for the original
> link that was posted, but the text in that page has changed and I never saw
> it.  None of those questions seem to apply to the above interface.

It was a more limited version of this interface (the problem with
length was more about what would happen if you would add such a

interface URLQuery {
  getter sequence<DOMString> (DOMString name);
  setter void (DOMString name, (sequence<DOMString> or DOMString) value);
  creator void (DOMString name, (sequence<DOMString> or DOMString) value);
  deleter void (DOMString name);

I don't know about JavaScript Map as to whether that would be reusable
in some way. We have some special requirements from last thread:

* Keys can have more than one value.
* Keys are ordered behind the scenes.

If it is reusable that would be great. I guess Web IDL then needs to
be updated somehow to give us some hooks.


More information about the whatwg mailing list