Bug 14569 - URL object should not return DOMTokenList
URL object should not return DOMTokenList
Status: RESOLVED FIXED
Product: WHATWG
Classification: Unclassified
Component: URL
unspecified
PC All
: P2 normal
: Unsorted
Assigned To: Anne
sideshowbarker+urlspec
http://dvcs.w3.org/hg/url/raw-file/ti...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-10-26 22:47 UTC by Erik Arvidsson
Modified: 2012-12-21 14:40 UTC (History)
8 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Erik Arvidsson 2011-10-26 22:47:21 UTC
http://dvcs.w3.org/hg/url/raw-file/tip/Overview.html

  readonly attribute DOMTokenList parameterNames;
  DOMTokenList getParameterAll(DOMString name);

These should both use DOMString[] instead of DOMTokenList.
Comment 1 Adam Barth 2011-10-26 23:54:22 UTC
The URL spec is probably going to wind up in the webapps WG.  That's probably the right "product" to file these bugs against.
Comment 2 Erik Arvidsson 2011-10-26 23:58:14 UTC
There is no good Component for this at the moment so randomly picking one.
Comment 3 Anne 2011-10-27 08:54:50 UTC
Something like DOMTokenList could rid us of getParameter(), appendParameter(), and clearParameter() though...
Comment 4 Anne 2011-10-27 10:10:05 UTC
Though I guess if it's a mutable array that goes for arrays too.
Comment 5 Anne 2011-10-27 10:13:07 UTC
Oops, ignore comment 3 and comment 4. Somehow forgot about values there. If we want to use a data structure it would have to be DOMStringMap or some such.
Comment 6 Erik Arvidsson 2011-10-27 16:45:08 UTC
(In reply to comment #5)
> Oops, ignore comment 3 and comment 4. Somehow forgot about values there. If we
> want to use a data structure it would have to be DOMStringMap or some such.

The problem is that the parameter names are not unique so a map would not really work either.

var url = new URL('http://www.example.com/index.cgi?a=A&b=B&a=A2');
url.parameterNames; // ['a', 'b', 'a']

I'm suggesting all these arrays would just be snapshots.
Comment 7 Adam Barth 2011-10-27 18:12:14 UTC
Yeah, the intention was for them to be snapshots.
Comment 8 Erik Arvidsson 2012-02-28 17:22:43 UTC
What is blocking the spec from being updated?

DOMString[] getParameterAll(DOMString name);
Comment 9 Adam Barth 2012-03-01 04:24:04 UTC
Fixed.
Comment 10 Anne 2012-03-01 08:52:30 UTC
You "fixed" this by changing Overview.html, rather than fixing Overview.src.html and generating Overview.html.
Comment 11 Anne 2012-03-01 08:53:32 UTC
Oops, missed something there reading the diff. Sorry!
Comment 12 Adam Barth 2012-03-01 08:56:18 UTC
I edited both manually, so I'm sure I screwed it up somehow.  :)