[whatwg] URL: URLQuery

Anne van Kesteren annevk at annevk.nl
Fri Dec 7 13:59:05 PST 2012


On Fri, Dec 7, 2012 at 5:27 PM, Simon Kaegi <Simon_Kaegi at ca.ibm.com> wrote:
> 1) "query" is a "read-only" and not nullable. I could do this of course
> but just want to understand the intent.

It's nullable because query manipulation in this manner does not make
sense for a whole lot of URL schemes. It's not readonly so you can
construct your own URLQuery object and replace the one of the URL
object.


> 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

This I have not done because the application/x-www-form-urlencoded
format does not do this either.

(Adding the iterators and such will come once IDL provides some hooks.)


> 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.

https://github.com/cweb/url-testing is a project towards tackling that
as far as URL parsing goes. I haven't seen anything comprehensive yet
for the API, apart from the tests from the WebKit project.


--
http://annevankesteren.nl/



More information about the whatwg mailing list