[whatwg] URL: URLQuery

Simon Kaegi simon.kaegi at gmail.com
Fri Dec 7 09:04:04 PST 2012


Anne,

Thanks for your work on this spec. I've updated my URL shim and we're now
beginning to make regular use of it in Orion (the project I work on).

Until I get a chance to organize this a bit (so you can see our tests etc)
the shim is here --
https://github.com/eclipse/orion.client/blob/master/bundles/org.eclipse.orion.client.core/web/orion/URL-shim.js

It's very close to your current IDL and I'll continue to follow along and
update it to bring it 100% in spec.

For differences...
"URL":
1) "query" is a "read-only" and not nullable. I could do this of course but
just want to understand the intent.

"URLQuery"
1) I've added in all the iterators (e.g. forEach, keys, values, items) as
per the current ES draft for Map.
2) I've added "clear" again as per the ES draft for Map
3) For "set" and "append" I accept null as a value (and also treat
undefined as null). I do this to differentiate between the "?param=" and
"?param" case.
So...
query.set("param", "") --> ?param=
query.set("param", null) or query.set("param") --> ?param

4) URLQuery Is not currently publicly constructable as again I wanted to
make sure I was understanding intent.

In the next few days I'll try to break this shim out of the main project
into another repo so it's a bit easier to see usage and also to add a
battery of tests for it. For the moment we've only been trying "http" and
have only limited testing with the non-hierarchical schemes like
"javascript", "data" etc. but will add more tests as we can.

If there is an existing URL test suite or something we could as a starting
point that would be helpful if you or anyone are aware of one.

-Simon


From: Anne van Kesteren <annevk at annevk.nl>
To: "Tab Atkins Jr." <jackalmage at gmail.com>,
Cc: WHATWG <whatwg at whatwg.org>
Date: 11/30/2012 12:44 PM
Subject: Re: [whatwg] URL: URLQuery
Sent by: whatwg-bounces at lists.whatwg.org



On Sat, Oct 13, 2012 at 12:24 AM, Tab Atkins Jr. <jackalmage at gmail.com>
wrote:
> If we do stick with the method-based map, I strongly feel we should
> match the JS Map API, and have a has() method as well.  *Ideally*,
> this would be a subclass of Map.

This is now done: http://url.spec.whatwg.org/#urlquery

Feedback welcome!

(Note that IDL bits for initializing with a dictionary and making it
based on Map underneath are still in progress.)


-- 
http://annevankesteren.nl/



More information about the whatwg mailing list